Palette mode coding in prediction process

ABSTRACT

Devices, systems and methods for video processing are described. An example method for video processing includes determining, for a conversion between a current block of a video and a bitstream representation of the video, a number of intra-coded neighboring blocks of the current block for a combined inter and intra prediction mode according to a rule that specifies that a first block coded using a first prediction mode is treated as a non-intra block to be excluded from counting of the number of intra-coded neighboring blocks. In the first prediction mode, reconstructed samples are represented by a set of representative color values, and the set of representative color values comprises at least one of 1) palette predictors, 2) escaped samples, or 3) palette information included in the bitstream. The method also includes performing the conversion based on the determining.

CROSS-REFERENCE TO RELATED APPLICATIONS

This application is a continuation of U.S. application Ser. No.17/585,704 filed on Jan. 27, 2022, which is a continuation ofInternational Patent Application No. PCT/CN2020/105405 filed on Jul. 29,2020, which claims the priority to and benefits of International PatentApplication No. PCT/CN2019/098204 filed on Jul. 29, 2019. All theaforementioned patent applications are hereby incorporated by referencein their entireties.

TECHNICAL FIELD

The present disclosure is related to video and image coding and decodingtechnologies.

BACKGROUND

Digital video accounts for the largest bandwidth use on the internet andother digital communication networks. As the number of connected userdevices capable of receiving and displaying video increases, it isexpected that the bandwidth demand for digital video usage will continueto grow.

SUMMARY

The disclosed embodiments may be used by video or image decoder orencoder embodiments for in which palette mode coding is used.

In one example aspect, a method of video processing is disclosed. Themethod includes performing a conversion between a block of a videoregion of a video and a bitstream representation of the video. Thebitstream representation is processed according to a first format rulethat specifies whether a first indication of usage of a palette mode issignalled for the block and a second format rule that specifies aposition of the first indication relative to a second indication ofusage of a prediction mode for the block.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo region in a video and a bitstream representation of the video, aprediction mode based on one or more allowed prediction modes thatinclude at least a palette mode of the block. An indication of usage ofthe palette mode is determined according to the prediction mode. Themethod also includes performing the conversion based on the one or moreallowed prediction modes.

In another example aspect, a method of video processing is disclosed.The method includes performing a conversion between a block of a videoand a bitstream representation of the video. The bitstreamrepresentation is processed according to a format rule that specifies afirst indication of usage of a palette mode and a second indication ofusage of an intra block copy (IBC) mode are signalled dependent of eachother.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, a presence of anindication of usage of a palette mode in the bitstream representationbased on a dimension of the block; and performing the conversion basedon the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, a presence of anindication of usage of an intra block copy (IBC) mode in the bitstreamrepresentation based on a dimension of the block; and performing theconversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, whether a palettemode is allowed for the block based on a second indication of a videoregion containing the block; and performing the conversion based on thedetermining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, whether an intrablock copy (IBC) mode is allowed for the block based on a secondindication of a video region containing the block; and performing theconversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, a first bit depth ofa first sample associated with a palette entry in a palette mode. Thefirst bit depth is different from a second bit depth associated with theblock. The method also includes performing the conversion based on thedetermining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a currentblock of a video and a bitstream representation of the video, that aneighboring block of the current block that is coded in a palette modeis processed as an intra-coded block having a default mode during aconstruction of a list of most probable modes (MPM) candidates of thecurrent block in case the neighboring block is located above or left ofthe current block. The method also includes performing the conversionbased on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of a video that is coded ina bitstream representation of the video as a palette mode coded block, aparameter for deblocking filtering according to a rule. The method alsoincludes performing a conversion between the block and the bitstreamrepresentation of the video using the parameter for deblockingfiltering.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a currentblock of a video and a bitstream representation of the video, that aneighboring block of the current block that is coded in a palette modeis processed as a non-intra coded block during a construction of a listof most probable modes (MPM) candidates of the current block. The methodalso includes performing the conversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of a video, a quantizationparameter associated with the block, coding the block of the video intoa bitstream representation of the video as a palette coded block in partbased on a modified value of the quantization parameter, and signallingcoded information related to the quantization parameter in the bitstreamrepresentation.

In another example aspect, a method of video processing is disclosed.The method includes deriving a quantization parameter based on abitstream representation of a video and decoding a palette coded blockin part based on a modified quantization parameter determined bymodifying the quantization parameter.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of a video that is coded ina bitstream representation of the video as a palette coded block, arepresentation of an escape sample of the block in the bitstreamrepresentation regardless of whether a bypass mode is enabled for theblock. The method also includes performing a conversion between theblock and the bitstream representation based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of a video that is coded ina bitstream representation of the video as a palette coded block, afirst quantization process. The first quantization process is differentfrom a second quantization process applicable to a non-palette modecoded block. The method also includes performing a conversion betweenthe block and the bitstream representation based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes performing a conversion between a video comprisingluma blocks and corresponding chroma blocks and a bitstreamrepresentation of the video according to a rule. The rule specifiesthat, for a case that a current luma block is coded using a palettecoding mode and a corresponding current chroma block coded with aderived mode, the current luma block is treated as having a defaultintra prediction mode and the current chroma block is coded with thedefault intra prediction mode. The palette coding mode comprises codingthe current luma block using a palette of representative sample values.

In another example aspect, a method of video processing is disclosed.The method includes performing a conversion between a video comprisingone or more blocks and a bitstream representation of the video. For theconversion, a list of motion candidates is constructed for each blockaccording to a rule. The rule specifies that the motion information of ablock coded using a palette coding mode is treated as unavailable orinvalid for coding successive blocks.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of video that is coded in abitstream representation of the video as a palette mode coded block, anumber of context coded bins of the block based on a rule. The methodalso includes performing a conversion between the block of the video andthe bitstream representation of the video based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes performing a conversion between a video comprisingluma blocks and corresponding chroma blocks and a bitstreamrepresentation of the video according to a rule that specifies that, fora case that a current luma block is coded using a palette coding modeand a corresponding current chroma block coded with a derived mode, thecurrent luma block is treated as having a default intra prediction modeand the current chroma block is coded with the default intra predictionmode. The palette coding mode comprises coding the current luma blockusing a palette of representative sample values.

In another example aspect, a method of video processing is disclosed.The method includes performing a conversion between a video comprisingone or more blocks and a bitstream representation of the video, wherefor the conversion, a list of motion candidates is constructed for eachblock according to a rule that specifies that the motion information ofa block coded using a palette coding mode is treated as unavailable orinvalid for coding successive blocks.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a block of video that is coded in abitstream representation of the video as a palette mode coded block, anumber of context coded bins of the block based on a rule. The methodalso includes performing a conversion between the block of the video andthe bitstream representation of the video based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a currentblock of a video and a bitstream representation of the video, a numberof intra-coded neighboring blocks of the current block for a combinedinter and intra prediction mode according to a rule. The rule specifiesa manner of treating a block coded using a palette coding mode incounting the number of intra-coded neighboring blocks for the combinedinter and intra prediction mode, where using the palette coding modecomprises coding a block using a palette of representative samplevalues. The method also includes performing the conversion based on thedetermining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a currentblock of a video and a bitstream representation of the video, that anoperation is skipped for a sample of the current block in a filteringprocess. The sample is coded using a palette coding mode, where usingthe palette coding mode comprises coding a block using a palette ofrepresentative sample values. The method also includes performing theconversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, a scanning orderselected from three or more scanning orders. The block is coded in apalette mode using a palette of representative sample values. The methodalso includes performing the conversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, one or more scanningorders in which coefficients of the block are scanned based on a shapeof the block. The method also includes performing the conversion basedon the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a conversion between a block of avideo and a bitstream representation of the video, that only onescanning order in which coefficients of the block are scanned is appliedto the block for a block-based quantized residual domain differentialpulse coding modulation (BDPCM) process in which a difference between aquantized residual of an intra prediction of the block and a predictionof the quantized residual is represented in the bitstream representationof the block using a differential pulse coding modulation (DPCM). Themethod also includes performing the conversion based on the determining.

In another example aspect, a method of video processing is disclosed.The method includes determining that palette mode is to be used forprocessing a transform unit, a coding block, or a region, usage ofpalette mode being coded separately from a prediction mode, andperforming further processing of the transform unit, the coding block,or the region using the palette mode.

In another example aspect, a method of video processing is disclosed.The method includes determining, for a current video block, that asample associated with one palette entry of a palette mode has a firstbit depth that is different from a second bit depth associated with thecurrent video block, and performing, based on at least the one paletteentry, further processing of the current video block.

In another example aspect, another method of video processing isdisclosed. The method includes performing a conversion between a currentvideo block of a picture of a video and a bitstream representation ofthe video in which information about whether or not an intra block copymode is used in the conversion is signalled in the bitstreamrepresentation or derived based on a coding condition of the currentvideo block, where the intra block copy mode comprises coding thecurrent video block from another video block in the picture.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining whether or not a deblockingfilter is to be applied during a conversion of a current video block ofa picture of video, where the current video block is coded using apalette mode coding in which the current video block is representedusing representative sample values that are fewer than total pixels ofthe current video block and performing the conversion such that thedeblocking filter is applied in case the determining is that thedeblocking filter is to be applied.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining a quantization or an inversequantization process for use during a conversion between a current videoblock of a picture of a video and a bitstream representation of thevideo, where the current video block is coded using a palette modecoding in which the current video block is represented usingrepresentative sample values that are fewer than total pixels of thecurrent video block and performing the conversion based on thedetermining the quantization or the inverse quantization process.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining, for a conversion between acurrent video block of a video comprising multiple video blocks and abitstream representation of the video, that the current video block is apalette-coded block; based on the determining, performing a listconstruction process of most probable mode by considering the currentvideo block to be an intra coded block, and performing the conversionbased on a result of the list construction process, where thepalette-coded block is coded or decoded using a palette orrepresentation sample values.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining, for a conversion between acurrent video block of a video comprising multiple video blocks and abitstream representation of the video, that the current video block is apalette-coded block; based on the determining, performing a listconstruction process of most probable mode by considering the currentvideo block to be a non-intra coded block, and performing the conversionbased on a result of the list construction process where thepalette-coded block is coded or decoded using a palette orrepresentation sample values.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining, for a conversion between acurrent video block of a video comprising multiple video blocks and abitstream representation of the video, that the current video block is apalette-coded block; based on the determining, performing a listconstruction process by considering the current video block to be anunavailable block, and performing the conversion based on a result ofthe list construction process, where the palette-coded block is coded ordecoded using a palette or representation sample values.

In yet another example aspect, another method of video processing isdisclosed. The method includes determining, during a conversion betweena current video block and a bitstream representation of the currentvideo block, that the current video block is a palette coded block,determining, based on the current video block being the palette codedblock, a range of context coded bins used for the conversion; andperforming the conversion based on the range of context coded bins.

In yet another example aspect, the above-described method may beimplemented by a video encoder apparatus that comprises a processor.

In yet another example aspect, these methods may be embodied in the formof processor-executable instructions and stored on a computer-readableprogram medium.

These, and other, aspects are further described in the presentdisclosure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows an example of intra block copy.

FIG. 2 shows an example of a block coded in palette mode.

FIG. 3 shows an example of use of a palette predictor to signal paletteentries.

FIG. 4 shows an example of horizontal and vertical traverse scans.

FIG. 5 shows an example of coding of palette indices.

FIG. 6 is a block diagram of an example of a video processing apparatus.

FIG. 7 shows a block diagram of an example embodiment of a videoencoder.

FIG. 8 is a flowchart for an example of a video processing method.

FIG. 9 shows an example of pixels involved in filter on/off decision andstrong/weak filter selection.

FIG. 10 shows an example of binarization of four modes.

FIG. 11 shows an example of binarization of four modes.

FIG. 12 shows examples of 67 intra mode prediction directions.

FIG. 13 shows examples of neighboring video blocks.

FIG. 14 shows examples of adaptive loop filter (ALF) filter shapes(chroma: 5×5 diamond, luma: 7×7 diamond).

FIG. 15A shows an examples of sub sampled Laplacian calculation forvertical gradient.

FIG. 15B shows an examples of subsampled Laplacian calculation forhorizontal gradient.

FIG. 15C shows an examples of subsampled Laplacian calculation fordiagonal gradient.

FIG. 15D shows an examples of subsampled Laplacian calculation fordiagonal gradient.

FIG. 16 shows an examples of modified block classification at virtualboundaries.

FIG. 17 shows an examples of modified ALF filtering for luma componentat virtual boundaries.

FIG. 18 shows an example of four one-dimensional (1-D) 3-pixel patternsfor the pixel classification in EO.

FIG. 19 shows an example of four bands are grouped together andrepresented by its starting band position.

FIG. 20 shows an example of top and left neighboring blocks used incombination of intra and inter prediction (CIIP) weight derivation.

FIG. 21 shows an example of luma mapping with chroma scalingarchitecture.

FIG. 22 shows an example of scanning order for a 4×4 block.

FIG. 23 shows another example of scanning order for a 4×4 block.

FIG. 24 is a block diagram showing an example video processing system inwhich various embodiments disclosed herein may be implemented.

FIG. 25 is a flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 26 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 27 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 28 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 29 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 30 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 31 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 32 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 33 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 34 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 35 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 36A is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 36B is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 37 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 38 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 39 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 40 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 41 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 42 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 43 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 44 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 45 is another flowchart representation of another method for videoprocessing in accordance with the present embodiments.

FIG. 46 is yet another flowchart representation of another method forvideo processing in accordance with the present embodiments.

DETAILED DESCRIPTION

The present disclosure provides various embodiments that can be used bya decoder of image or video bitstreams to improve the quality ofdecompressed or decoded digital video or images. For brevity, the term“video” is used herein to include both a sequence of pictures(traditionally called video) and individual images. Furthermore, a videoencoder may also implement these embodiments during the process ofencoding in order to reconstruct decoded frames used for furtherencoding.

Section headings are used in the present disclosure for ease ofunderstanding and do not limit the embodiments to the correspondingsections. As such, embodiments from one section can be combined withembodiments from other sections.

1. Summary

This disclosure is related to video coding technologies. Specifically,it is related to palette coding with employing base colors basedrepresentation in video coding. It may be applied to the existing videocoding standard like high efficiency video coding (HEVC), or thestandard (versatile video coding (VVC)) to be finalized. It may be alsoapplicable to future video coding standards or video codec.

2. Initial Discussion

Video coding standards have evolved primarily through the development ofthe well-known International Telecommunication Union (ITU)Telecommunication Standardization Sector (ITU-T) and InternationalOrganization for Standardization (ISO)/International ElectrotechnicalCommission (IEC) standards. The ITU-T produced H.261 and H.263, ISO/IECproduced Moving Picture Experts Group (MPEG)-1 and MPEG-4 Visual, andthe two organizations jointly produced the H.262/MPEG-2 Video andH.264/MPEG-4 Advanced Video Coding (AVC) and H.265/HEVC standards. SinceH.262, the video coding standards are based on the hybrid video codingstructure wherein temporal prediction plus transform coding areutilized. To explore the future video coding technologies beyond HEVC,Joint Video Exploration Team (JVET) was founded by Video Coding ExpertsGroup (VCEG) and MPEG jointly in 2015. Since then, many new methods havebeen adopted by JVET and put into the reference software named JointExploration Model (JEM). In April 2018, the Joint Video Expert Team(JVET) between VCEG (Q6/16) and ISO/IEC JTC1 SC29/WG11 (MPEG) wascreated to work on the VVC standard targeting a 50% bitrate reductioncompared to HEVC.

FIG. 7 is a block diagram of an example embodiment of a video encoder.FIG. 7 shows that the encoder has a built-in feedback path in which thevideo encoder also performs video decoding functionality (reconstructingcompressed representation of video data for use in encoding of nextvideo data).

2.1 Intra Block Copy

Intra block copy (IBC) (also referred to as current picture referencing)has been adopted in HEVC Screen Content Coding extensions (HEVC-SCC) andthe current VVC test model (VTM-4.0). IBC extends the concept of motioncompensation from inter-frame coding to intra-frame coding. Asdemonstrated in FIG. 1 , the current block is predicted by a referenceblock in the same picture when IBC is applied. The samples in thereference block must have been already reconstructed before the currentblock is coded or decoded. Although IBC is not so efficient for mostcamera-captured sequences, it shows significant coding gains for screencontent. The reason is that there are lots of repeating patterns, suchas icons and text characters in a screen content picture. IBC can removethe redundancy between these repeating patterns effectively. InHEVC-SCC, an inter-coded coding unit (CU) can apply IBC if it choosesthe current picture as its reference picture. The MV is renamed as blockvector (BV) in this case, and a BV always has an integer-pixelprecision. To be compatible with main profile HEVC, the current pictureis marked as a “long-term” reference picture in the decoded picturebuffer (DPB). It should be noted that similarly, in multipleview/three-dimensional (3D) video coding standards, the inter-viewreference picture is also marked as a “long-term” reference picture.

Following a BV to find its reference block, the prediction can begenerated by copying the reference block. The residual can be got bysubtracting the reference pixels from the original signals. Thentransform and quantization can be applied as in other coding modes.

However, when a reference block is outside of the picture, or overlapswith the current block, or outside of the reconstructed area, or outsideof the valid area restricted by some constrains, part or all pixelvalues are not defined. Basically, there are two solutions to handlesuch a problem. One is to disallow such a situation, e.g., in bitstreamconformance. The other is to apply padding for those undefined pixelvalues. The following sub-sessions describe the solutions in detail.

2.2 IBC in HEVC Screen Content Coding Extensions

In the screen content coding extensions of HEVC, when a block usescurrent picture as reference, it should guarantee that the wholereference block is within the available reconstructed area, as indicatedin the following spec text:

-   -   The variables offsetX and offsetY are derived as follows:

offsetX=(ChromaArrayType==0)?0:(mvCLX[0]&0x7?2:0)  (8-106)

offsetY=(ChromaArrayType==0)?0:(mvCLX[1]& 0x7?2:0)  (8-107)

-   -   It is a requirement of bitstream conformance that when the        reference picture is the current picture, the luma motion vector        mvLX shall obey the following constraints:        -   When the derivation process for z-scan order block            availability as specified in clause 6.4.1 is invoked with            (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring            luma location (xNbY, yNbY) set equal to            (xPb+(mvLX[0]>>2)−offsetX, yPb+(mvLX[1]>>2)−offsetY) as            inputs, the output shall be equal to TRUE.        -   When the derivation process for z-scan order block            availability as specified in clause 6.4.1 is invoked with            (xCurr, yCurr) set equal to (xCb, yCb) and the neighbouring            luma location (xNbY, yNbY) set equal to            (xPb+(mvLX[0]>>2)+nPbW−1+offsetX,            yPb+(mvLX[1]>>2)+nPbH−1+offsetY) as inputs, the output shall            be equal to TRUE.        -   One or both the following conditions shall be true:    -   The value of (mvLX[0]>>2)+nPbW+xB1+offsetX is less than or equal        to 0.    -   The value of (mvLX[1]>>2)+nPbH+yB1+offsetY is less than or equal        to 0.        -   The following condition shall be true:

(xPb+(mvLX[0]>>2)+nPbSw−1+offsetX)/CtbSizeY−xCurr/CtbSizeY<=yCurr/CtbSizeY−(yPb+(mvLX[1]>>2)+nPbSh−1+offsetY)/CtbSizeY  (8-108)

Thus, the case that the reference block overlaps with the current block,or the reference block is outside of the picture will not happen. Thereis no need to pad the reference or prediction block.

2.3 IBC in VVC Test Model

In the current VVC test model, e.g., VTM-4.0 design, the whole referenceblock should be with the current coding tree unit (CTU) and does notoverlap with the current block. Thus, there is no need to pad thereference or prediction block. The IBC flag is coded as a predictionmode of the current coding unit (CU). Thus, there are totally threeprediction modes, MODE_INTRA, MODE_INTER and MODE_IBC for each CU.

2.3.1 IBC Merge Mode

In IBC merge mode, an index pointing to an entry in the IBC mergecandidates list is parsed from the bitstream. The construction of theIBC merge list can be summarized according to the following sequence ofsteps:

Step 1: Derivation of spatial candidates

Step 2: Insertion of history-based motion vector prediction (HMVP)candidates

Step 3: Insertion of pairwise average candidates

In the derivation of spatial merge candidates, a maximum of four mergecandidates are selected among candidates located in the positionsdepicted in the figures. The order of derivation is A1, B1, B0, A0 andB2. Position B2 is considered only when any prediction unit (PU) ofposition A1, B1, B0, A0 is not available (e.g., because it belongs toanother slice or tile) or is not coded with IBC mode. After candidate atposition A1 is added, the insertion of the remaining candidates issubject to a redundancy check which ensures that candidates with samemotion information are excluded from the list so that coding efficiencyis improved. To reduce computational complexity, not all possiblecandidate pairs are considered in the mentioned redundancy check.Instead only the pairs linked with an arrow in depicted in the figuresare considered and a candidate is only added to the list if thecorresponding candidate used for redundancy check has not the samemotion information.

After insertion of the spatial candidates, if the IBC merge list size isstill smaller than the maximum IBC merge list size, IBC candidates fromHMVP table may be inserted. Redundancy check are performed wheninserting the HMVP candidates.

Finally, pairwise average candidates are inserted into the IBC mergelist.

When a reference block identified by a merge candidate is outside of thepicture, or overlaps with the current block, or outside of thereconstructed area, or outside of the valid area restricted by someconstrains, the merge candidate is called invalid merge candidate.

It is noted that invalid merge candidates may be inserted into the IBCmerge list.

2.3.2 IBC Advanced Motion Vector Prediction (AMVP) Mode

In IBC AMVP mode, an AMVP index point to an entry in the IBC AMVP listis parsed from the bitstream. The construction of the IBC AMVP list canbe summarized according to the following sequence of steps:

Step 1: Derivation of spatial candidates

Check A0, A1 until an available candidate is found.

Check B0, B1, B2 until an available candidate is found.

Step 2: Insertion of HMVP candidates

Step 3: Insertion of zero candidates

After insertion of the spatial candidates, if the IBC AMVP list size isstill smaller than the maximum IBC AMVP list size, IBC candidates fromHMVP table may be inserted.

Finally, zero candidates are inserted into the IBC AMVP list.

2.4 Palette Mode

The basic idea behind a palette mode is that the samples in the CU arerepresented by a small set of representative color values. This set isreferred to as the palette. It is also possible to indicate a samplethat is outside the palette by signalling an escape symbol followed by(possibly quantized) component values. This is illustrated in FIG. 2 .

2.5 Palette Mode in HEVC Screen Content Coding extensions (HEVC-SCC)

In the palette mode in HEVC-SCC, a predictive way is used to code thepalette and index map.

2.5.1 Coding of the Palette Entries

For coding of the palette entries, a palette predictor is maintained.The maximum size of the palette as well as the palette predictor issignalled in the Sequence Parameter Set (SPS). In HEVC-SCC, apalette_predictor initializer_present_flag is introduced in the PPS.When this flag is 1, entries for initializing the palette predictor aresignalled in the bitstream. The palette predictor is initialized at thebeginning of each CTU row, each slice and each tile. Depending on thevalue of the palette_predictor initializer_present_flag, the palettepredictor is reset to 0 or initialized using the palette predictorinitializer entries signalled in the PPS. In HEVC-SCC, a palettepredictor initializer of size 0 was enabled to allow explicit disablingof the palette predictor initialization at the PPS level.

For each entry in the palette predictor, a reuse flag is signalled toindicate whether it is part of the current palette. This is illustratedin FIG. 3 . The reuse flags are sent using run-length coding of zeros.After this, the number of new palette entries are signalled usingexponential Golomb code of order 0. Finally, the component values forthe new palette entries are signalled.

2.5.2 Coding of Palette Indices

The palette indices are coded using horizontal and vertical traversescans as shown in FIG. 4 . The scan order is explicitly signalled in thebitstream using the palette_transpose_flag. For the rest of thesubsection it is assumed that the scan is horizontal.

The palette indices are coded using two main palette sample modes:‘INDEX’ and ‘COPY_ABOVE’. As explained previously, the escape symbol isalso signalled as an ‘INDEX’ mode and assigned an index equal to themaximum palette size. The mode is signalled using a flag except for thetop row or when the previous mode was ‘COPY_ABOVE’. In the ‘COPY_ABOVE’mode, the palette index of the sample in the row above is copied. In the‘INDEX’ mode, the palette index is explicitly signalled. For both‘INDEX’ and ‘COPY_ABOVE’ modes, a run value is signalled which specifiesthe number of subsequent samples that are also coded using the samemode. When escape symbol is part of the run in ‘INDEX’ or ‘COPY_ABOVE’mode, the escape component values are signalled for each escape symbol.The coding of palette indices is illustrated in FIG. 5 .

This syntax order is accomplished as follows. First the number of indexvalues for the CU is signalled. This is followed by signalling of theactual index values for the entire CU using truncated binary coding.Both the number of indices as well as the index values are coded inbypass mode. This groups the index-related bypass bins together. Thenthe palette sample mode (if necessary) and run are signalled in aninterleaved manner. Finally, the component escape values correspondingto the escape samples for the entire CU are grouped together and codedin bypass mode.

An additional syntax element, last_run_type_flag, is signalled aftersignalling the index values. This syntax element, in conjunction withthe number of indices, eliminates the need to signal the run valuecorresponding to the last run in the block.

In HEVC-SCC, the palette mode is also enabled for 4:2:2, 4:2:0, andmonochrome chroma formats. The signalling of the palette entries andpalette indices is almost identical for all the chroma formats. In caseof non-monochrome formats, each palette entry consists of 3 components.For the monochrome format, each palette entry consists of a singlecomponent. For subsampled chroma directions, the chroma samples areassociated with luma sample indices that are divisible by 2. Afterreconstructing the palette indices for the CU, if a sample has only asingle component associated with it, only the first component of thepalette entry is used. The only difference in signalling is for theescape component values. For each escape sample, the number of escapecomponent values signalled may be different depending on the number ofcomponents associated with that sample.

In VVC, the dual tree coding structure is used on coding the intraslices, so the luma component and two chroma components may havedifferent palette and palette indices. In addition, the two chromacomponent shares same palette and palette indices.

2.6 Deblocking Scheme in VVC

Note that, in the following descriptions, pN_(M) denotes the left-sideN-th sample in the M-th row relative to the vertical edge or thetop-side N-th sample in the M-th column relative to the horizontal edge,qN_(M) denotes the right-side N-th sample in the M-th row relative tothe vertical edge or the bottom-side N-th sample in the M-th columnrelative to the horizontal edge. An example of pN_(M) and qN_(M) isdepicted in FIG. 9 .

Note that, in the following descriptions, p_(N) denotes the left-sideN-th sample in a row relative to the vertical edge or the top-side N-thsample in a column relative to the horizontal edge, q_(N) denotes theright-side N-th sample in a row relative to the vertical edge or thebottom-side N-th sample in a column relative to the horizontal edge.

Filter on/off decision is done for four lines as a unit. FIG. 9illustrates the pixels involving in filter on/off decision. The 6 pixelsin the two red boxes for the first four lines are used to determinefilter on/off for 4 lines. The 6 pixels in two red boxes for the second4 lines are used to determine filter on/off for the second four lines.

In some embodiments, the vertical edges in a picture are filtered first.Then the horizontal edges in a picture are filtered with samplesmodified by the vertical edge filtering process as input. The verticaland horizontal edges in the CTBs of each CTU are processed separately ona coding unit basis. The vertical edges of the coding blocks in a codingunit are filtered starting with the edge on the left-hand side of thecoding blocks proceeding through the edges towards the right-hand sideof the coding blocks in their geometrical order. The horizontal edges ofthe coding blocks in a coding unit are filtered starting with the edgeon the top of the coding blocks proceeding through the edges towards thebottom of the coding blocks in their geometrical order.

2.6.1 Boundary Decision

Filtering is applied to 8×8 block boundaries. In addition, it must be atransform block boundary or a coding subblock boundary (e.g., due tousage of Affine motion prediction (ATMVP)). For those which are not suchboundaries, filter is disabled.

2.6.2 Boundary Strength Calculation

For a transform block boundary/coding subblock boundary, if it islocated in the 8×8 grid, it may be filtered and the setting ofbS[xD_(i)][yD_(j)] (wherein [xD_(i)][yD_(j)] denotes the coordinate) forthis edge is defined as follows:

-   -   If the sample p₀ or q₀ is in the coding block of a coding unit        coded with intra prediction mode, bS[xD_(i)][yD_(j)] is set        equal to 2.    -   Otherwise, if the block edge is also a transform block edge and        the sample p₀ or q₀ is in a transform block which contains one        or more non-zero transform coefficient levels,        bS[xD_(i)][yD_(j)] is set equal to 1.    -   Otherwise, if the prediction mode of the coding subblock        containing the sample p₀ is different from the prediction mode        of the coding subblock containing the sample q₀,        bS[xD_(i)][yD_(j)] is set equal to 1.    -   Otherwise, if one or more of the following conditions are true,        bS[xD_(i)][yD_(j)] is set equal to 1:    -   The coding subblock containing the sample p₀ and the coding        subblock containing the sample q₀ are both coded in IBC        prediction mode, and the absolute difference between the        horizontal or vertical component of the motion vectors used in        the prediction of the two coding subblocks is greater than or        equal to 4 in units of quarter luma samples.    -   For the prediction of the coding subblock containing the sample        p₀ different reference pictures or a different number of motion        vectors are used than for the prediction of the coding subblock        containing the sample q₀.

NOTE 1—The determination of whether the reference pictures used for thetwo coding sublocks are the same or different is based only on whichpictures are referenced, without regard to whether a prediction isformed using an index into reference picture list 0 or an index intoreference picture list 1, and also without regard to whether the indexposition within a reference picture list is different.

NOTE 2—The number of motion vectors that are used for the prediction ofa coding subblock with top-left sample covering (xSb, ySb), is equal toPredFlagL0[xSb][ySb]+PredFlagL1[xSb][ySb].

-   -   One motion vector is used to predict the coding subblock        containing the sample p₀ and one motion vector is used to        predict the coding subblock containing the sample q₀, and the        absolute difference between the horizontal or vertical component        of the motion vectors used is greater than or equal to 4 in        units of quarter luma samples.    -   Two motion vectors and two different reference pictures are used        to predict the coding subblock containing the sample p₀, two        motion vectors for the same two reference pictures are used to        predict the coding subblock containing the sample q₀ and the        absolute difference between the horizontal or vertical component        of the two motion vectors used in the prediction of the two        coding subblocks for the same reference picture is greater than        or equal to 4 in units of quarter luma samples.    -   Two motion vectors for the same reference picture are used to        predict the coding subblock containing the sample p₀, two motion        vectors for the same reference picture are used to predict the        coding subblock containing the sample q₀ and both of the        following conditions are true:    -   The absolute difference between the horizontal or vertical        component of list 0 motion vectors used in the prediction of the        two coding subblocks is greater than or equal to 4 in quarter        luma samples, or the absolute difference between the horizontal        or vertical component of the list 1 motion vectors used in the        prediction of the two coding subblocks is greater than or equal        to 4 in units of quarter luma samples.    -   The absolute difference between the horizontal or vertical        component of list 0 motion vector used in the prediction of the        coding subblock containing the sample p₀ and the list 1 motion        vector used in the prediction of the coding subblock containing        the sample q₀ is greater than or equal to 4 in units of quarter        luma samples, or the absolute difference between the horizontal        or vertical component of the list 1 motion vector used in the        prediction of the coding subblock containing the sample p₀ and        list 0 motion vector used in the prediction of the coding        subblock containing the sample q₀ is greater than or equal to 4        in units of quarter luma samples.    -   Otherwise, the variable bS[xD_(i)][yD_(j)] is set equal to 0.

Table 2-1 and 2-2 summarize the BS calculation rules.

TABLE 2-1 Boundary strength (when SPS IBC is disabled) PriorityConditions Y U V 5 At least one of the adjacent blocks is intra 2 2 2 4Transform Unit (TU) boundary and at least 1 1 1 one of the adjacentblocks has non-zero transform coefficients 3 Reference pictures ornumber of motion 1 N/A N/A vectors (MVs) (1 for uni-prediction, 2 forbi-prediction) of the adjacent blocks are different 2 Absolutedifference between the motion 1 N/A N/A vectors of same referencepicture that belong to the adjacent blocks is greater than or equal toone integer luma sample 1 Otherwise 0 0 0

TABLE 2-2 Boundary strength (when SPS IBC is enabled) PriorityConditions Y U V 8 At least one of the adjacent blocks is intra 2 2 2 7TU boundary and at least one of the adjacent 1 1 1 blocks has non-zerotransform coefficients 6 Prediction mode of adjacent blocks is different1 (e.g., one is IBC, one is inter) 5 Both IBC and absolute differencebetween the 1 N/A N/A motion vectors that belong to the adjacent blocksis greater than or equal to one integer luma sample 4 Reference picturesor number of MVs (1 for 1 N/A N/A uni-prediction, 2 for bi-prediction)of the adjacent blocks are different 3 Absolute difference between themotion vectors 1 N/A N/A of same reference picture that belong to theadjacent blocks is greater than or equal to one integer luma sample 1Otherwise 0 0 0

2.6.3 Deblocking Decision for Luma Component

The deblocking decision process is described in this sub-section.

Wider-stronger luma filter is filters are used only if all of theCondition1, Condition2 and Condition 3 are TRUE.

The condition 1 is the “large block condition”. This condition detectswhether the samples at P-side and Q-side belong to large blocks, whichare represented by the variable bSidePisLargeBlk and bSideQisLargeBlkrespectively. The bSidePisLargeBlk and bSideQisLargeBlk are defined asfollows.

bSidePisLargeBlk=((edge type is vertical and p ₀ belongs to CU withwidth >=32)∥(edge type is horizontal and p ₀ belongs to CU with height>=32))?TRUE:FALSE

bSideQisLargeBlk=((edge type is vertical and q ₀ belongs to CU withwidth >=32)∥(edge type is horizontal and q ₀ belongs to CU with height>=32))?TRUE:FALSE

Based on bSidePisLargeBlk and bSideQisLargeBlk, the condition 1 isdefined as follows.

Condition1=(bSidePisLargeBlk bSidePisLargeBlk)?TRUE:FALSE

Next, if Condition 1 is true, the condition 2 will be further checked.First, the following variables are derived:

-   -   dp0, dp3, dq0, dq3 are first derived as in HEVC    -   if (p side is greater than or equal to 32)

dp0=(dp0+Abs(p5₀−2*p4₀ +p3₀)+1)>>1

dp3=(dp3+Abs(p5₃−2*p4₃ +p3₃)+1)>>1

-   -   if (q side is greater than or equal to 32)

dq0=(dq0+Abs(q5₀−2*q4₀ +q3₀)+1)>>1

dq3=(dq3+Abs(q5₃−2*q4₃ +q3₃)+1)>>1

Condition2=(d<β)?TRUE: FALSE

where d=dp0+dq0+dp3+dq3, as shown in section 2.2.4.

If Condition1 and Condition2 are valid, whether any of the blocks usessub-blocks is further checked:

  If (bSidePisLargeBlk)  If (mode block P == SUBBLOCKMODE)   Sp =5  Else  Sp =7  Else   Sp = 3 If (bSideQisLargeBlk)  If (mode block Q ==SUBBLOCKMODE)   Sq =5  Else   Sq =7  Else   Sq = 3

Finally, if both the Condition 1 and Condition 2 are valid, the proposeddeblocking method will check the condition 3 (the large block strongfilter condition), which is defined as follows.

In the Condition3 StrongFilterCondition, the following variables arederived:

  dpq is derived as in HEVC. sp₃ = Abs( p₃ − p₀ ), derived as in HEVC if(p side is greater than or equal to 32)   if(Sp==5)    sp₃ = ( sp₃ +Abs( p₅ − p₃ ) + 1) >> 1   Else    sp₃ = ( sp₃ + Abs( p₇ − p₃ ) + 1) >>1  sq₃ = Abs( q₀ − q₃ ), derived as in HEVC  if (q side is greater thanor equal to 32)   If(Sq=5)    sq₃ = ( sq₃ + Abs( q₅ − q₃ ) + 1) >> 1  Else    sq₃ = ( sq₃ + Abs( q₇ − q₃ ) + 1) >> 1

As in HEVC, StrongFilterCondition=(dpq is less than (β>>2), sp₃+sq₃ isless than (3*β>>5), and Abs(p₀−q₀) is less than (5*t_(C)+1)>>1)?TRUE:FALSE.

2.6.4 Stronger Deblocking Filter for Luma (Designed for Larger Blocks)

Bilinear filter is used when samples at either one side of a boundarybelong to a large block. A sample belonging to a large block is definedas when the width >=32 for a vertical edge, and when height >=32 for ahorizontal edge.

The bilinear filter is listed below.

Block boundary samples p_(i) for i=0 to Sp-1 and q_(i) for j=0 to Sq-1(pi and qi are the i-th sample within a row for filtering vertical edge,or the i-th sample within a column for filtering horizontal edge) inHEVC deblocking described above) are then replaced by linearinterpolation as follows:

p _(i)′=(f _(i)*Middle_(s,t)+(64−f _(i))*P _(s)+32)>>6),clipped to p_(i)±tcPD_(i)

q _(j)′=(g _(j)*Middle_(s,t)+(64−g _(j))*Q _(s)+32)>>6),clipped to q₁±tcPD₁

where tcPD_(i) and tcPD₁ term is a position dependent clipping describedin Section 2.3.6 and g_(j), f_(i) Middle_(s,t), P_(s) and Q_(s) aregiven in Table 2-3:

TABLE 2-3 Long tap deblocking filters Sp, Sq f_(i) = 59 − i * 9, canalso be described as f = {59, 50, 41, 32, 23, 14, 5} 7, 7 g_(j) = 59 −j * 9, can also be described as g = {59, 50, 41, 32, 23, 14, 5} (p side:7, Middle_(7,7) = (2* (p_(o) + q_(o)) + p₁ + q₁ + p₂ + q₂ + p₃ + q₃ +p₄ + q₄ + p₅ + q₅ + p₆ + q₆ + 8) >> 4 q side: 7) P₇ = (p₆ + p₇ + 1) >>1, Q₇ = (q₆ + q₇ + 1) >> 1 7, 3 f_(i) = 59 − i * 9, can also bedescribed as f = {59, 50, 41, 32, 23, 14, 5} (p side: 7 g_(j) = 53 − j *21, can also be described as g = {53, 32, 11} q side: 3) Middle_(7,3) =(2 * (p_(o) + q_(o)) + q₀ + 2 * (q₁ + q₂) + p₁ + q₁ + p₂ + p₃ + p₄ +p₅ + p₆ + 8) >> 4 p₇ = (p₆ + p₇ + 1) >> 1, Q₃ = (q₂ + q₃ + 1) >> 1 3, 7g_(j) = 59 − j * 9, can also be described as g = {59, 50, 41, 32, 23,14, 5} (p side: 3 f_(i) = 53 − i * 21, can also be described as f = {53,32, 11} q side: 7) Middle_(3.7) = (2 * (q_(o) + p_(o)) + p₀ + 2 * (p₁ +p₂) + q₁ + p₁ + q₂ + q₃ + q₄ + q₅ + q₆ + 8) >> 4 Q₇ = (q₆ + q₇ + 1) >>1, P₃ = (p₂ + p₃ + 1) >> 1 7, 5 g_(j) = 58 − j * 13, can also bedescribed as g = {58, 45, 32, 19, 6} (p side: 7 f_(i) = 59 − i * 9, canalso be described as f = {59, 50, 41, 32, 23, 14, 5} q side: 5) Middle7,5 = (2 * (p_(o) + q_(o) + p₁ + q₁) + q₂ + p₂ + q₃ + p₃ + q₄ + p₄ + q₅ +p₅ + 8) >> 4 Q₅ = (q₄ + q₅ + 1) >> 1, P₇ = (p₆ + p₇ + 1) >> 1 5, 7 g_(j)= 59 − j * 9, can also be described as g = {59, 50, 41, 32, 23, 14, 5}(p side: 5 f_(i) = 58 − i * 13, can also be described as f = {58, 45,32, 19, 6} q side: 7) Middle5, 7 = (2 * (q_(o) + p_(o) + p₁ + q₁) + q₂ +p₂ + q₃ + p₃ + q₄ + p₄ + q₅ + p₅ + 8) >> 4 Q₇ = (q₆ + q₇ + 1) >> 1, P₅ =(p₄ + p₅ + 1) >> 1 5, 5 g_(j) = 58 − j * 13, can also be described as g= {58, 45, 32, 19, 6} (p side: 5 f_(i) = 58 − i * 13, can also bedescribed as f = {58, 45, 32, 19, 6} q side: 5) Middle5, 5 = (2 *(q_(o) + p_(o) + p₁ + q₁ + q₂ + p₂) + q₃ + p₃ + q₄ + p₄ + 8) >> 4 Q₅ =(q₄ + q₅ + 1) >> 1, P₅ = (p₄ + p₅ + 1) >> 1 5, 3 g_(j) = 53 − j * 21,can also be described as g = {53, 32, 11} (p side: 5 f_(i) = 58 − i *13, can also be described as f = {58, 45, 32, 19, 6} q side: 3) Middle5,3 = (q_(o)+ p_(o) + p₁ + q₁ + q₂ + p₂ + q₃ + p₃ + 4) >> 3 Q₃ = (q₂ +q₃ + 1) >> 1, P₅ = (p₄ + p₅ + 1) >> 1 3, 5 g_(j) = 58 − j * 13, can alsobe described as g = {58, 45, 32, 19, 6} (p side: 3 f_(i) = 53 − i * 21,can also be described as f = {53, 32, 11} q side: 5) Middle3, 5 =(q_(o) + p_(o) + p₁ + q₁ + q₂ + p₂ + q₃ + 4) >> 3 Q₅ = (q₄ + q₅ + 1) >>1, P₃ = (p₂ + p₃ + 1) >> 1

2.6.5 Deblocking Control for Chroma

The chroma strong filters are used on both sides of the block boundary.Here, the chroma filter is selected when both sides of the chroma edgeare greater than or equal to 8 (chroma position), and the followingdecision with three conditions are satisfied: the first one is fordecision of boundary strength as well as large block. The proposedfilter can be applied when the block width or height which orthogonallycrosses the block edge is equal to or larger than 8 in chroma sampledomain. The second and third one is basically the same as for HEVC lumadeblocking decision, which are on/off decision and strong filterdecision, respectively.

In the first decision, boundary strength (bS) is modified for chromafiltering as shown in Table 2-2. The conditions in Table 2-2 are checkedsequentially. If a condition is satisfied, then the remaining conditionswith lower priorities are skipped.

Chroma deblocking is performed when bS is equal to 2, or bS is equal to1 when a large block boundary is detected.

The second and third condition is basically the same as HEVC luma strongfilter decision as follows.

In the second condition: d is then derived as in HEVC luma deblocking.

The second condition will be TRUE when d is less than β.

In the third condition StrongFilterCondition is derived as follows:

dpq is derived as in HEVC

sp₃=Abs(p₃−p₀), derived as in HEVC

sq₃=Abs(q₀−q₃), derived as in HEVC

As in HEVC design, StrongFilterCondition=(dpq is less than (β>>2),sp₃+sq₃ is less than (β>>3), and Abs(p₀−q₀) is less than (5*t_(C)+1)>>1)

2.6.6 Strong Deblocking Filter for Chroma

The following strong deblocking filter for chroma is defined:

p ₂′=(3*p ₃+2*p ₂ +p ₁ +p ₀ +q ₀+4)>>3

p ₁′=(2*p ₃ +p ₂+2*p ₁ +p ₀ +q ₀ +q ₁+4)>>3

p ₀′=(p ₃ +p ₂ +p _(i)+2*p ₀ +q ₀ +q ₁ +q ₂+4)>>3

The proposed chroma filter performs deblocking on a 4×4 chroma samplegrid.

2.6.7 Position Dependent Clipping

The position dependent clipping (tcPD) is applied to the output samplesof the luma filtering process involving strong and long filters that aremodifying 7, 5, and 3 samples at the boundary. Assuming quantizationerror distribution, it is proposed to increase clipping value forsamples which are expected to have higher quantization noise, thusexpected to have higher deviation of the reconstructed sample value fromthe true sample value.

For each P or Q boundary filtered with asymmetrical filter, depending onthe result of decision-making process in section 2.3.3, positiondependent threshold table is selected from two tables (i.e., Tc7 and Tc3tabulated below) that are provided to decoder as a side information:

Tc7={6, 5, 4, 3, 2, 1, 1};

Tc3={6, 4, 2};

tcPD=(Sp==3)?Tc3:Tc7;

tcQD=(Sq==3)?Tc3:Tc7;

For the P or Q boundaries being filtered with a short symmetricalfilter, position dependent threshold of lower magnitude is applied:

Tc3={3, 2, 1};

Following defining the threshold, filtered p′_(i) and q′_(j) samplevalues are clipped according to tcP and tcQ clipping values:

p″ _(i)=Clip3(p′ _(i) +tcP _(i) ,p′ _(i) −tcP _(i) ,p′ _(i));

q″ _(j)=Clip3(q′ _(j) +tcQ _(j) ,q′ _(j) −tcQ _(j) ,q′ _(j));

where p′_(i) and q′_(i) are filtered sample values, p″_(i) and q″_(j)are output sample value after the clipping and tcP_(i) are clippingthresholds that are derived from the VVC tc parameter and tcPD and tcQD.The function Clip3 is a clipping function as it is specified in VVC.

2.6.8 Sub-Block Deblocking Adjustment

To enable parallel friendly deblocking using both long filters andsub-block deblocking the long filters is restricted to modify at most 5samples on a side that uses sub-block deblocking (AFFINE or ATMVP ordecoder-side motion vector refinement (DMVR)) as shown in the lumacontrol for long filters. Additionally, the sub-block deblocking isadjusted such that that sub-block boundaries on an 8×8 grid that areclose to a CU or an implicit TU boundary is restricted to modify at mosttwo samples on each side.

Following applies to sub-block boundaries that not are aligned with theCU boundary.

  If (mode block Q == SUBBLOCKMODE && edge !=0) {  if (!(implicitTU &&(edge == (64 / 4))))   if (edge == 2 || edge == (orthogonalLength − 2)|| edge = (56 / 4) || edge == (72 / 4))    Sp = Sq = 2;   Else    Sp =Sq = 3,  Else   Sp = Sq = bSideQisLargeBlk ? 5:3 }

Where edge equal to 0 corresponds to CU boundary, edge equal to 2 orequal to orthogonalLength-2 corresponds to sub-block boundary 8 samplesfrom a CU boundary etc. Where implicit TU is true if implicit split ofTU is used.

2.6.9 Restriction to 4CTU/2CTU Line Buffers for Luma/Chroma

Filtering of horizontal edges is limiting Sp=3 for luma, Sp=1 and Sq=1for chroma, when the horizontal edge is aligned with the CTU boundary.

2.7 Intra Mode Coding in VVC

To capture the arbitrary edge directions presented in natural video, thenumber of directional intra modes in VTM5 is extended from 33, as usedin HEVC, to 65. The new directional modes not in HEVC are depicted asred dotted arrows in FIG. 12 , and the planar and DC modes remain thesame. These denser directional intra prediction modes apply for allblock sizes and for both luma and chroma intra predictions.

In VTM5, several conventional angular intra prediction modes areadaptively replaced with wide-angle intra prediction modes for thenon-square blocks. Wide angle intra prediction is described in Section3.3.1.2.

In HEVC, every intra-coded block has a square shape and the length ofeach of its side is a power of 2. Thus, no division operations arerequired to generate an intra-predictor using DC mode. In VTM5, blockscan have a rectangular shape that necessitates the use of a divisionoperation per block in the general case. To avoid division operationsfor DC prediction, only the longer side is used to compute the averagefor non-square blocks.

To keep the complexity of the most probable mode (MPM) list generationlow, an intra mode coding method with 6 MPMs is used by considering twoavailable neighboring intra modes. The following three aspects areconsidered to construct the MPM list:

1. Default intra modes

2. Neighbouring intra modes

3. Derived intra modes

A unified 6-MPM list is used for intra blocks irrespective of whethermultiple reference line (MRL) and intra sub partitions (ISP) codingtools are applied or not. The MPM list is constructed based on intramodes of the left and above neighboring block. Suppose the mode of theleft block is denoted as Left and the mode of the above block is denotedas Above, the unified MPM list is constructed as follows (The left andabove blocks are shown in FIG. 13 .

-   -   When a neighboring block is not available, its intra mode is set        to Planar by default.    -   If both modes Left and Above are non-angular modes:        -   MPM list→{Planar, DC, V, H, V−4, V+4}    -   If one of modes Left and Above is angular mode, and the other is        non-angular:        -   Set a mode Max as the larger mode in Left and Above        -   MPM list→{Planar, Max, DC, Max −1, Max +1, Max −2}    -   If Left and Above are both angular and they are different        -   Set a mode Max as the larger mode in Left and Above        -   if the difference of mode Left and Above is in the range of            2 to 62, inclusive            -   MPM list→{Planar, Left, Above, DC, Max −1, Max+1}        -   Otherwise            -   MPM list→{Planar, Left, Above, DC, Max −2, Max+2}    -   If Left and Above are both angular and they are the same:        -   MPM list→{Planar, Left, Left −1, Left +1, DC, Left −2}

Besides, the first bin of the MPM index codeword is context-adaptivebinary arithmetic coded (CABAC) context coded. In total three contextsare used, corresponding to whether the current intra block is MRLenabled, ISP enabled, or a normal intra block.

During 6 MPM list generation process, pruning is used to removeduplicated modes so that only unique modes can be included into the MPMlist. For entropy coding of the 61 non-MPM modes, a truncated binarycode (TBC) is used.

For chroma intra mode coding, a total of 8 intra modes are allowed forchroma intra mode coding. Those modes include five traditional intramodes and three cross-component linear model modes (CCLM, LM_A, andLM_L). Chroma mode signalling and derivation process are shown in Table2-4. Chroma mode coding directly depends on the intra prediction mode ofthe corresponding luma block. Since separate block partitioningstructure for luma and chroma components is enabled in I slices, onechroma block may correspond to multiple luma blocks. Therefore, forChroma DM mode, the intra prediction mode of the corresponding lumablock covering the center position of the current chroma block isdirectly inherited.

TABLE 2-4 Derivation of chroma prediction mode from luma mode whencclm_is enabled Corresponding luma intra prediction mode Chroma Xprediction mode 0 50 18 1 ( 0 <= X <= 66 ) 0 66 0 0 0 0 1 50 66 50 50 502 18 18 66 18 18 3 1 1 1 66 1 4 81 81 81 81 81 5 82 82 82 82 82 6 83 8383 83 83 7 0 50 18 1 X

2.8 Quantized Residual Block Differential Pulse-Code Modulation(QR-BDPCM)

In some embodiments, a quantized residual block differential pulse-codemodulation (QR-BDPCM) is proposed to code screen contents efficiently.

The prediction directions used in QR-BDPCM can be vertical andhorizontal prediction modes. The intra prediction is done on the entireblock by sample copying in prediction direction (horizontal or verticalprediction) similar to intra prediction. The residual is quantized andthe delta between the quantized residual and its predictor (horizontalor vertical) quantized value is coded. This can be described by thefollowing: For a block of size M (rows)×N (cols), let r_(i,j), 0≤i≤M−1,0≤j≤N−1 be the prediction residual after performing intra predictionhorizontally (copying left neighbor pixel value across the predictedblock line by line) or vertically (copying top neighbor line to eachline in the predicted block) using unfiltered samples from above or leftblock boundary samples. Let Q(r_(i,j)), 0≤i≤M−1, 0≤j≤N−1 denote thequantized version of the residual r_(i,j), where residual is differencebetween original block and the predicted block values. Then the blockDPCM is applied to the quantized residual samples, resulting in modifiedM×N array {tilde over (R)} with elements {tilde over (r)}_(i,j). Whenvertical BDPCM is signalled:

$\begin{matrix}{{\overset{˜}{r}}_{i,j} = \left\{ \begin{matrix}{{Q\left( r_{i,j} \right)},} & {{i = 0},{0 \leq j \leq \left( {N - 1} \right)}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{{({i - 1})},j} \right)}},} & {{1 \leq i \leq \left( {M - 1} \right)},{0 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & \left( {2 - 7 - 1} \right)\end{matrix}$

For horizontal prediction, similar rules apply, and the residualquantized samples are obtained by

$\begin{matrix}{{\overset{˜}{r}}_{i,j} = \left\{ \begin{matrix}{{Q\left( r_{i,j} \right)},} & {{0 \leq i \leq \left( {M - 1} \right)},{j = 0}} \\{{{Q\left( r_{i,j} \right)} - {Q\left( r_{i,{({j - 1})}} \right)}},} & {{0 \leq i \leq \left( {M - 1} \right)},{1 \leq j \leq \left( {N - 1} \right)}}\end{matrix} \right.} & \left( {2 - 7 - 2} \right)\end{matrix}$

The residual quantized samples {tilde over (r)}_(i,j) are sent to thedecoder.

On the decoder side, the above calculations are reversed to produceQ(r_(i,j)), 0≤i≤M−1, 0≤j≤N−1. For vertical prediction case,

Q(r _(i,j))=Σ_(k=0) ^(i) {tilde over (r)}_(k,j),0≤i≤(M−1),0≤j≤(N−1)  (2-7-3)

For horizontal case,

Q(r _(i,j))=Σ_(k=0) ^(j) {tilde over (r)}_(i,k),0≤i≤(M−1),0≤j≤(N−1)  (2-7-4)

The inverse quantized residuals, Q⁻¹ (Q(r_(i,j))), are added to theintra block prediction values to produce the reconstructed samplevalues.

The main benefit of this scheme is that the inverse DPCM can be done onthe fly during coefficient parsing simply adding the predictor as thecoefficients are parsed or it can be performed after parsing.

2.9 Adaptive Loop Filter

In the VTM5, an Adaptive Loop Filter (ALF) with block-based filteradaption is applied. For the luma component, one among 25 filters isselected for each 4×4 block, based on the direction and activity oflocal gradients.

2.9.1 Filter Shape

In the VTM5, two diamond filter shapes (as shown in FIG. 14 ) are used.The 7×7 diamond shape is applied for luma component and the 5×5 diamondshape is applied for chroma components.

2.9.2 Block Classification

For luma component, each 4×4 block is categorized into one out of 25classes. The classification index C is derived based on itsdirectionality D and a quantized value of activity A, as follows:

C=5D+Â  (2-9-1)

To calculate D and Â, gradients of the horizontal, vertical and twodiagonal direction are first calculated using 1-D Laplacian:

g _(v)=Σ_(k=i−2) ^(i+3)Σ_(l=j−2) ^(j+3) V _(k,l) ,V_(k,l)=|2R(k,l)−R(k,l−1)−R(k,l+1)|  (2-9-2)

g _(h)=Σ_(k=i−2) ^(i+3)Σ_(l=j−3) ^(j+3) H _(k,l) ,H_(k,l)=|2R(k,l)−R(k−1,l)−R(k+1,l)|  (2-9-3)

g _(d1)=Σ_(k=i−2) ^(i+3)Σ_(l=j−3) ^(j+3) D1_(k,l),D1_(k,l)=|2R(k,l)−R(k−1,l−1)−R(k+1,l+1)|  (2-9-4)

g _(d2)=Σ_(k=i−2) ^(i+3)Σ_(j=j−2) ^(j+3) D2_(k,l),D2_(k,l)=|2R(k,l)−R(k−1,l+1)−R(k+1,l−1)|  (2-9-5)

Where indices i and j refer to the coordinates of the upper left samplewithin the 4×4 block and R(i, j) indicates a reconstructed sample atcoordinate (i,j).

To reduce the complexity of block classification, the subsampled 1-DLaplacian calculation is applied. As shown in FIG. 15A-D, the samesubsampled positions are used for gradient calculation of alldirections.

Then D maximum and minimum values of the gradients of horizontal andvertical directions are set as:

g _(h,v) ^(max)=max(g _(h) ,g _(v)),g _(h,v) ^(min)=min(g _(h) ,g_(v))  (2-9-6)

The maximum and minimum values of the gradient of two diagonaldirections are set as:

g _(d0,d1) ^(max)=max(g _(d0) ,g _(d1)),g _(d0,d1) ^(min)=min(g _(d0) ,g_(d1))  (2-9-7)

To derive the value of the directionality D, these values are comparedagainst each other and with two thresholds t₁ and t₂:

Step 1. If both g_(h,v) ^(max)≤t₁·g_(h,v) ^(min) and g_(d0,d1) ^(max)≤t₁g_(d0,d1) ^(min) are true, D is set to 0.Step 2. If g_(h,v) ^(max)/g_(h,v) ^(min)>g_(d0,d1) ^(max)/g_(d0,d1)^(min), continue from Step 3; otherwise continue from Step 4.Step 3. If g_(h,v) ^(max)>t₂·g_(h,v) ^(min), D is set to 2; otherwise Dis set to 1.Step 4. If g_(d0,d1) ^(max)>t₂·g_(d0,d1) ^(min), D is set to 4;otherwise D is set to 3.

The activity value A is calculated as:

A=Σ _(k=i−2) ^(i+3)Σ_(l=j−2) ^(j+3)(V _(k,l) +H _(k,l))  (2-9-8)

A is further quantized to the range of 0 to 4, inclusively, and thequantized value is denoted as Â.

For chroma components in a picture, no classification method is applied,i.e., a single set of ALF coefficients is applied for each chromacomponent.

2.9.3. Geometric Transformations of Filter Coefficients and ClippingValues

Before filtering each 4×4 luma block, geometric transformations such asrotation or diagonal and vertical flipping are applied to the filtercoefficients f (k, 1) and to the corresponding filter clipping valuesc(k, 1) depending on gradient values calculated for that block. This isequivalent to applying these transformations to the samples in thefilter support region. The idea is to make different blocks to which ALFis applied more similar by aligning their directionality.

Three geometric transformations, including diagonal, vertical flip androtation are introduced:

Diagonal:f _(D)(k,l)=f(l,k),c _(D)(k,l)=c(l,k),  (2-9-9)

Vertical flip:f _(V)(k,1)=f(k,K−l−1),c _(V)(k,l)=c(k,K−l−1)  (2-9-10)

Rotation:f _(R)(k,l)=f(K−l−1,k),c _(R)(k,l)=c(K−l−1,k)  (2-9-11)

where K is the size of the filter and 0≤k, l≤K−1 are coefficientscoordinates, such that location (0,0) is at the upper left corner andlocation (K−1, K−1) is at the lower right corner. The transformationsare applied to the filter coefficients f (k, l) and to the clippingvalues c(k, l) depending on gradient values calculated for that block.The relationship between the transformation and the four gradients ofthe four directions are summarized in the following table.

TABLE 2-5 Mapping of the gradient calculated for one block and thetransformations Gradient values Transformation g_(d2) < g_(d1) and g_(h)< g_(v) No transformation g_(d2) < g_(d1) and g_(v) < g_(h) Diagonalg_(d1) < g_(d2) and g_(h) < g_(v) Vertical flip g_(d1) < g_(d2) andg_(v) < g_(h) Rotation

2.9.4 Filter Parameters Signalling

In the VTM5, ALF filter parameters are signalled in Adaptation ParameterSet (APS). In one APS, up to 25 sets of luma filter coefficients andclipping value indexes, and up to one set of chroma filter coefficientsand clipping value indexes could be signalled. To reduce bits overhead,filter coefficients of different classification can be merged. In sliceheader, the indices of the APSs used for the current slice aresignalled.

Clipping value indexes, which are decoded from the APS, allowdetermining clipping values using a Luma table of clipping values and aChroma table of clipping values. These clipping values are dependent ofthe internal bitdepth. More precisely, the Luma table of clipping valuesand Chroma table of clipping values are obtained by the followingformulas:

$\begin{matrix}{{{AlfClip}_{L} = \left\{ {{{round}\left( 2^{B\frac{N - n + 1}{N}} \right){for}n} \in \left\lbrack {1\ldots N} \right\rbrack} \right\}},} & \left( {2 - 9 - 12} \right)\end{matrix}$ $\begin{matrix}{{AlfClip}_{C} = \left\{ {{{round}\left( 2^{{({B - 8})} + {8\frac{({N - n})}{N - 1}}} \right){for}n} \in \left\lbrack {1\ldots N} \right\rbrack} \right\}} & \left( {2 - 9 - 13} \right)\end{matrix}$

with B equal to the internal bitdepth and N equal to 4 which is thenumber of allowed clipping values in VTM5.0.

The filtering process can be controlled at CTB level. A flag is alwayssignalled to indicate whether ALF is applied to a luma CTB. A luma CTBcan choose a filter set among 16 fixed filter sets and the filter setsfrom APSs. A filter set index is signalled for a luma CTB to indicatewhich filter set is applied. The 16 fixed filter sets are pre-definedand hard-coded in both the encoder and the decoder.

The filter coefficients are quantized with norm equal to 128. In orderto restrict the multiplication complexity, a bitstream conformance isapplied so that the coefficient value of the non-central position shallbe in the range of −2⁷ to 2⁷−1, inclusive. The central positioncoefficient is not signalled in the bitstream and is considered as equalto 128.

2.9.5 Filtering Process

At decoder side, when ALF is enabled for a CTB, each sample R(i, j)within the CU is filtered, resulting in sample value R′(i, j) as shownbelow,

R′(i,j)=E(i,j)+((Σ_(k≠0)Σ_(t≠0) f(k,l)×K(R(ik,j+l)−R(i,j),c(k,l))+64)>>7)   (2-9-14)

where f (k, l) denotes the decoded filter coefficients, K(x, y) is theclipping function and c(k, l) denotes the decoded clipping parameters.The variable k and l varies between −

$\frac{L}{2}{and}\frac{L}{2}$

where L denotes the filter length. The clipping function K(x, y)=min(y,max(−y, x)) which corresponds to the function Clip3 (−y, y, x).

2.9.6 Virtual Boundary Filtering Process for Line Buffer Reduction InVTM5, to reduce the line buffer requirement of ALF, modified blockclassification and filtering are employed for the samples nearhorizontal CTU boundaries. For this purpose, a virtual boundary isdefined as a line by shifting the horizontal CTU boundary with “N”samples as shown in FIG. 16 , with N equal to 4 for the Luma componentand 2 for the Chroma component.

Modified block classification is applied for the Luma component asdepicted in FIG. 2-11 . For the 1D Laplacian gradient calculation of the4×4 block above the virtual boundary, only the samples above the virtualboundary are used. Similarly for the 1D Laplacian gradient calculationof the 4×4 block below the virtual boundary, only the samples below thevirtual boundary are used. The quantization of activity value A isaccordingly scaled by taking into account the reduced number of samplesused in 1D Laplacian gradient calculation.

For filtering processing, symmetric padding operation at the virtualboundaries are used for both Luma and Chroma components. As shown inFIG. 17 , when the sample being filtered is located below the virtualboundary, the neighboring samples that are located above the virtualboundary are padded. Meanwhile, the corresponding samples at the othersides are also padded, symmetrically.

2.10 Sample Adaptive Offset (SAO)

Sample adaptive offset (SAO) is applied to the reconstructed signalafter the deblocking filter by using offsets specified for each CTB bythe encoder. The HM encoder first makes the decision on whether or notthe SAO process is to be applied for current slice. If SAO is appliedfor the slice, each CTB is classified as one of five SAO types as shownin Table 2-6. The concept of SAO is to classify pixels into categoriesand reduces the distortion by adding an offset to pixels of eachcategory. SAO operation includes Edge Offset (EO) which uses edgeproperties for pixel classification in SAO type 1-4 and Band Offset (BO)which uses pixel intensity for pixel classification in SAO type 5. Eachapplicable CTB has SAO parameters includingsao_merge_left_flag,_sao_merge_up_flag, SAO type and four offsets. Ifsao_merge_left_flag is equal to 1, the current CTB will reuse the SAOtype and offsets of the CTB to the left. If sao_merge_up_flag is equalto 1, the current CTB will reuse SAO type and offsets of the CTB above.

TABLE 2-6 Specification of SAO type Number of SAO type sample adaptiveoffset type to be used categories 0 None 0 1 1-D 0-degree pattern edgeoffset 4 2 1-D 90-degree pattern edge offset 4 3 1-D 135-degree patternedge offset 4 4 1-D 45-degree pattern edge offset 4 5 band offset 4

2.10.1. Operation of Each SAO Type

Edge offset uses four 1-D 3-pixel patterns for classification of thecurrent pixel p by consideration of edge directional information, asshown in FIG. 18 . From left to right these are: 0-degree, 90-degree,135-degree and 45-degree.

Each CTB is classified into one of five categories according to Table2-7.

TABLE 2-7 Pixel classification rule for EO Category Condition Meaning 0None of the below Largely monotonic 1 p < 2 neighbors Local minimum 2 p< 1 neighbor && p = = 1 Edge neighbour 3 p > 1 neighbor && p = = 1 Edgeneighbor 4 p > 2 neighbors Local maximum

Band offset (B0) classifies all pixels in one CTB region into 32 uniformbands by using the five most significant bits of the pixel value as theband index. In other words, the pixel intensity range is divided into 32equal segments from zero to the maximum intensity value (e.g., 255 for8-bit pixels). Four adjacent bands are grouped together and each groupis indicated by its most left-hand position as shown in FIG. 19 . Theencoder searches all position to get the group with the maximumdistortion reduction by compensating offset of each band.

2.11 Combined Inter and Intra Prediction (CIIP)

In VTM5, when a CU is coded in merge mode, if the CU contains at least64 luma samples (that is, CU width times CU height is equal to or largerthan 64), and if both CU width and CU height are less than 128 lumasamples, an additional flag is signalled to indicate if the combinedinter/intra prediction (CIIP) mode is applied to the current CU. As itsname indicates, the CIIP prediction combines an inter prediction signalwith an intra prediction signal. The inter prediction signal in the CIIPmode P_(inter) is derived using the same inter prediction processapplied to regular merge mode; and the intra prediction signal P_(intra)is derived following the regular intra prediction process with theplanar mode. Then, the intra and inter prediction signals are combinedusing weighted averaging, where the weight value is calculated dependingon the coding modes of the top and left neighboring blocks (depicted inFIG. 20 ) as follows:

-   -   If the top neighbor is available and intra coded, then set        isIntraTop to 1, otherwise set isIntraTop to 0;    -   If the left neighbor is available and intra coded, then set        isIntraLeft to 1, otherwise set isIntraLeft to 0;    -   If (isIntraLeft+isIntraLeft) is equal to 2, then wt is set to 3;    -   Otherwise, if (isIntraLeft+isIntraLeft) is equal to 1, then wt        is set to 2;    -   Otherwise, set wt to 1.

The CIIP prediction is formed as follows:

P _(CIIP)=((4−wt)*P _(inter) +wt*P _(intra)+2)>>2  (3-1)

2.12 Luma Mapping with Chroma Scaling (LMCS)

In VTM5, a coding tool called the luma mapping with chroma scaling(LMCS) is added as a new processing block before the loop filters. LMCShas two main components: 1) in-loop mapping of the luma component basedon adaptive piecewise linear models; 2) for the chroma components,luma-dependent chroma residual scaling is applied. FIG. 21 shows theLMCS architecture from decoder's perspective. The light-blue shadedblocks in FIG. 21 indicate where the processing is applied in the mappeddomain; and these include the inverse quantization, inverse transform,luma intra prediction and adding of the luma prediction together withthe luma residual. The unshaded blocks in FIG. 21 indicate where theprocessing is applied in the original (i.e., non-mapped) domain; andthese include loop filters such as deblocking, ALF, and SAO, motioncompensated prediction, chroma intra prediction, adding of the chromaprediction together with the chroma residual, and storage of decodedpictures as reference pictures. The light-yellow shaded blocks in FIG.21 are the new LMCS functional blocks, including forward and inversemapping of the luma signal and a luma-dependent chroma scaling process.Like most other tools in VVC, LMCS can be enabled/disabled at thesequence level using an SPS flag.

3. Examples of Problems Solved by Embodiments

One palette flag is usually used to indicate whether the palette mode isemployed on the current CU, which can have different limitations andvariances on its entropy coding. However, how to better code the paletteflag has not been fully studied in the previous video coding standards.

The palette samples may have visual artifact if they are processed bypost loop filtering process.

The palette scanning order could be improved for non-square blocks.

4. Examples of Embodiments

The detailed embodiments below should be considered as examples toexplain general concepts. These embodiments should not be interpreted ina narrow way. Furthermore, these embodiments can be combined in anymanner.

-   -   1. Indication of usage of palette mode for a transform        unit/prediction unit/coding block/region may be coded separately        from the prediction mode.        -   a. In one example, the prediction mode may be coded before            the indication of usage of palette.            -   i. Alternatively, furthermore, the indication of usage                of palette may be conditionally signalled based on the                prediction mode.                -   1. In one example, when the prediction mode is the                    intra block copy mode (i.e., MODE_IBC), the                    signalling of the indication of usage of palette                    mode may be skipped. Alternatively, furthermore, the                    indication of usage of palette may be inferred to                    false when the current prediction mode is MODE_IBC.                -   2. In one example, when the prediction mode is the                    inter mode (i.e., MODE_INTER), the signalling of the                    indication of usage of palette mode may be skipped.                    Alternatively, furthermore, the indication of usage                    of palette mode may be inferred to false when the                    current prediction mode is MODE_INTER.                -   3. In one example, when the prediction mode is the                    intra mode (i.e., MODE_INTRA), the signalling of the                    indication of usage of palette mode may be skipped.                    Alternatively, furthermore, the indication of usage                    of palette mode may be inferred to false when the                    current prediction mode is MODE_INTRA.                -   4. In one example, when the prediction mode is the                    skip mode (i.e., the skip flag equal to 1), the                    signalling of the indication of usage of palette                    mode may be skipped. Alternatively, furthermore, the                    indication of usage of palette mode may be inferred                    to false when the skip mode is employed on the                    current CU.                -   5. In one example, when the prediction mode is the                    intra mode (e.g., MODE_INTRA), the indication of                    usage of palette mode may be signalled.                    Alternatively, furthermore, when the prediction mode                    is the inter mode or intra block copy mode, the                    signalling of the indication of usage of palette                    mode may be skipped.                -    a) Alternatively, furthermore, when the prediction                    mode is the intra mode and not the Pulse-code                    modulation (PCM) mode, the indication of usage of                    palette mode may be signalled.                -    b) Alternatively, furthermore, when the prediction                    mode is the intra mode, the indication of usage of                    palette mode may be signalled before the indication                    of usage of the PCM mode. In one example, when                    palette mode is applied, the signalling of usage of                    PCM mode may be skipped.                -    c) Alternatively, furthermore, when the prediction                    mode is the inter mode or intra block copy mode, the                    signalling of the indication of usage of palette                    mode may be skipped.                -   6. In one example, when the prediction mode is the                    inter mode (e.g., MODE_INTER), the indication of                    usage of palette mode may be signalled.                -    a) Alternatively, when the prediction mode is the                    intra mode, the signalling of the indication of                    usage of palette mode may be skipped.                -   7. In one example, when the prediction mode is the                    intra block copy mode, the indication of usage of                    palette mode may be signalled. Alternatively,                    furthermore, when the prediction mode is the inter                    mode or intra mode, the signalling of the indication                    of usage of palette mode may be skipped.            -   ii. Alternatively, furthermore, the indication of usage                of palette mode may be conditionally signalled based on                the picture/slice/tile group type.        -   b. In one example, the prediction mode may be coded after            the indication of usage of palette mode.        -   c. In one example, indication of usage of palette mode may            be signalled when the prediction mode is INTRA mode or            INTER_MODE.            -   i. In one example, the indication of usage of palette                mode may be coded after the skip flag, prediction mode                and the flag of PCM mode.            -   ii. In one example, the indication of usage of palette                mode may be coded after the skip flag, prediction mode,                before the flag of PCM mode            -   iii. In one example, when the current block is coded                with intra mode, the indications of palette and IBC                modes may be further signalled.                -   1. In one example, one bit flag may be signalled to                    indicate whether palette or IBC mode is signalled.                -   2. In one example, signalling of the bit flag may be                    skipped under certain conditions, such as block                    dimension, whether IBC or palette mode is enabled                    for one tile/tile group/slice/picture/sequence.        -   d. In one example, the prediction mode (such as whether it            is intra or inter mode) may be coded firstly, followed by            the conditional signalling of whether it is palette mode or            not.            -   i. In one example, when the prediction mode is the intra                mode, another flag may be further signalled to indicate                whether it is palette mode or not.                -   1. In one example, the ‘another flag’ may be                    signalled when the palette mode is enabled for one                    video data unit (e.g., sequence/picture/tile                    group/tile).                -   2. In one example, the ‘another flag’ may be                    signalled under the condition of block dimension.                -   3. Alternatively, furthermore, if it is not palette                    mode, one flag may be further signalled to indicate                    whether it is PCM mode or not.                -   4. In one example, the ‘another flag’ may be context                    coded according to information of neighboring                    blocks. Alternatively, the ‘another flag’ may be                    context coded with only one context. Alternatively,                    the ‘another flag’ may be bypass coded, i.e.,                    without context.            -   ii. Alternatively, when the prediction mode is the inter                mode, another flag may be further signalled to indicate                whether it is IBC mode or not.                -   1. In one example, the ‘another flag’ may be                    signalled when the IBC mode is enabled for one video                    data unit (e.g., sequence/picture/tile group/tile).                -   2. In one example, the ‘another flag’ may be                    signalled under the condition of block dimension    -   2. It is proposed to add the palette mode as an additional        candidate for prediction mode. Therefore, there is no need to        signal the indication of usage of palette mode separately from        the prediction mode.        -   a. In one example, the prediction modes may include intra,            intra block copy and palette modes for intra slices/I            pictures/intra tile groups.        -   b. Alternatively, the prediction modes may include intra,            palette modes for intra slices/I pictures/intra tile groups.        -   c. In one example, the prediction modes may include intra,            intra block copy and palette modes for 4×4 blocks.        -   d. In one example, the prediction modes may include intra,            inter, intra block copy and palette modes for inter slices/P            and/or B pictures/inter tile groups.        -   e. In one example, the prediction modes may include intra,            inter, intra block copy modes for inter slices/P and/or B            pictures/inter tile groups.        -   f. Alternatively, the prediction modes may include at least            two of intra, inter, intra block copy and palette mode.        -   g. In one example, the inter mode may be not included in the            prediction modes for 4×4 blocks.        -   h. In one example, when the block is not coded as the skip            mode (which is a special case for the inter mode), the            prediction mode index may be signalled.            -   i. In one example, the binarization of the four modes is                defined as: intra (1), inter (00), IBC (010) and Palette                (011).            -   ii. In one example, the binarization of the four modes                is defined as: intra (10), inter (00), IBC (01) and                Palette (11), as shown in FIG. 10 .            -   iii. In one example, if the current slice is an intra                slice and IBC is not enabled in the SPS, the                binarization of the Palette and intra modes is defined                as: Palette (1) and intra (0).            -   iv. In one example, if the current slice is not an intra                slice and IBC is not enabled in the SPS, the                binarization of the Palette, inter and intra modes is                defined as: intra (1), inter (00), and Palette (01).            -   v. In one example, if the current slice is an intra                slice and IBC is enabled in the SPS, the binarization of                the Palette and intra modes is defined as: IBC (1),                Palette (01), and intra (00).            -   vi. In one example, the binarization of the four modes                is defined as: inter (1), intra (01), IBC (001) and                Palette (000).            -   vii. In one example, the binarization of the four modes                is defined as: intra (1), inter (01), IBC (001) and                Palette (000).            -   viii. In one example, the binarization of the four modes                is defined as: inter (0), intra (10), IBC (111) and                Palette (110), as shown in FIG. 11 .    -   3. The signalling of the indication of usage of palette/IBC mode        may depend on the information of other mode.        -   a. In one example, the indication of usage of palette mode            may be signalled when the current prediction mode is an            intra mode and not a IBC mode.        -   b. In one example, the indication of usage of IBC mode may            be signalled when the current prediction mode is an intra            mode and not a palette mode.    -   4. How to signal the mode information may depend on the        slice/picture/tile group type.        -   a. In one example, when it is I-slice/Intra tile group, one            flag may be signalled to indicate whether it is IBC mode. If            it is not the IBC mode, another flag may be further            signalled to indicate whether it is palette or intra mode.        -   b. In one example, when it is I-slice/Intra tile group, one            flag may be signalled to indicate whether it is intra mode.            If it is not the intra mode, another flag may be further            signalled to indicate whether it is palette or IBC mode.    -   5. The indication of usage of palette mode may be signalled        and/or derived based on the following conditions.        -   a. block dimension of current block            -   i. In one example, the indication of usage of palette                mode may be signalled only for blocks with width*height                smaller than or equal to a threshold, such as 64*64.            -   ii. In one example, the indication of usage of palette                mode may be signalled only for blocks with both width                and height larger than or equal to a threshold, such as                64            -   iii. In one example, the indication of usage of palette                mode may be signalled only for blocks with all below                conditions are true:                -   1. width and/or height larger than or equal to a                    threshold, such as 16;                -   2. width and/or height smaller than or equal to a                    threshold, such as 32 or 64            -   iv. In one example, the indication of usage of palette                mode may be signalled only for blocks with width equal                to height (i.e., square blocks)        -   b. prediction mode of current block        -   c. Current quantization parameter of current block        -   d. The palette flag of neighboring blocks        -   e. The intra block copy flags of neighboring blocks        -   f. Indication of the color format (such as 4:2:0, 4:4:4)        -   g. Separate/dual coding tree structure        -   h. Slice/tile group type and/or picture type    -   6. The indication of usage of IBC mode may be signalled and/or        derived based on the following conditions.        -   a. block dimension of current block            -   i. In one example, the indication of usage of IBC mode                may be signalled only for blocks with both width or                height smaller than 128        -   b. prediction mode of current block        -   c. Current quantization parameter of current block        -   d. The palette flag of neighboring blocks        -   e. The intra block copy flags of neighboring blocks        -   f. Indication of the color format (such as 4:2:0, 4:4:4)        -   g. Separate/dual coding tree structure        -   h. Slice/tile group type and/or picture type    -   7. The palette mode may be treated as intra mode (e.g.,        MODE_INTRA) in the deblocking decision process.        -   a. In one example, if the samples at p side or q side are            coded with palette mode, the boundary strength is set to 2.        -   b. In one example, if the samples both at p side and q side            are coded with palette mode, the boundary strength is set to            2        -   c. Alternatively, the palette mode may be treated as inter            mode (e.g., MODE_INTER) in the deblocking decision process.    -   8. The palette mode may be treated as a separate mode (e.g.,        MODE_PLT) in the deblocking decision process.        -   a. In one example, if the samples at p side and q side are            coded with palette mode, the boundary strength is set to 0.            -   i. Alternatively, if samples at one side are coded with                palette mode, the boundary strength is set to 0.        -   b. In one example, if the samples at p side are coded with            IBC mode and the samples at q side are coded with palette            mode, the boundary strength is set to 1, vice versa.        -   c. In one example, if the samples at p side are coded with            intra mode and the samples at q side are coded with palette            mode, the boundary strength is set to 2, vice versa.    -   9. The palette mode may be treated as a transform-skip block in        the deblocking process        -   a. Alternatively, the palette mode may be treated as a BDPCM            block in the deblocking process.    -   10. The indication of usage of palette mode for a block may be        signalled and/or derived based on the slice/tile group/picture        level flag        -   a. In one example, the flag indicates whether fractional            motion vector difference (MVD) is allowed in the merge with            motion vector difference (MMVD, a.k.a., UMVE) and/or            adaptive motion vector resolution (AMVR) mode, (e.g.,            slice_fracmmvd_flag). Alternatively, furthermore, if the            slice_fracmmvd_flag indicates fractional MVD is enabled, the            signalling of indication of usage of palette mode is skipped            and palette mode is inferred to be disabled.        -   b. In one example, the flag indicates whether palette mode            is enabled for the slice/tile group/picture. Alternatively,            furthermore, when such a flag indicates palette mode is            disabled, the signalling of usage of palette mode for a            block is skipped and palette mode is inferred to be            disabled.    -   11. The indication of usage of intra block copy mode (IBC) for a        block may be signalled and/or derived based on the slice/tile        group/picture level flag.        -   a. In one example, the flag indicates whether fractional            motion vector difference (MVD) is allowed in the merge with            motion vector difference (MMVD, a.k.a., UMVE) and/or            adaptive motion vector resolution (AMVR) mode, (e.g.,            slice_fracmmvd_flag). Alternatively, furthermore, if the            slice_fracmmvd_flag indicates fractional MVD is enabled, the            signalling of indication of usage of IBC mode is skipped and            IBC mode is inferred to be disabled.        -   b. In one example, the flag indicates whether IBC mode is            enabled for the slice/tile group/picture. Alternatively,            furthermore, when such a flag indicates IBC mode is            disabled, the signalling of usage of IBC mode for a block is            skipped and IBC mode is inferred to be disabled.    -   12. The sample associated with one palette entry may have        different bit depths from the internal bit depth and/or the bit        depth of original/reconstructed samples.        -   a. In one example, denote the sample associated with one may            have the bit depth equal to N, the following may apply:            -   i. In one example, N may be a integer number (e.g., 8).            -   ii. In one example, N may be larger than the internal                bit depth and/or the bit depth of original/reconstructed                samples.            -   iii. In one example, N may be smaller than the internal                bit depth and/or the bit depth of original/reconstructed                samples.            -   iv. In one example, N may depend on                -   1. Block dimension of current block                -   2. Current quantization parameter of current block                -   3. Indication of the color format (such as 4:2:0,                    4:4:4)                -   4. Separate/dual coding tree structure                -   5. Slice/tile group type and/or picture type                -   6. Number of palette entries                -   7. Number of prediction palette entries                -   8. Index of color component        -   b. In one example, the sample associated with multiple            palette entries may have different bit depths.            -   i. In one example, let C0, C1 be two palette entries in                the current palette, and they may have bit depth equal                to b0 and b1, respectively. b0 may be unequal to b1.                -   1. In one example, b0 may be larger/smaller than the                    internal bit depth and/or the bit depth of                    original/reconstructed samples and/or b1 may be                    larger/smaller than the internal bit depth and/or                    the bit depth of original/reconstructed samples.        -   c. In one example, in the palette mode, the samples may be            reconstructed according to the shifted values of samples            associated with palette entries.            -   i. In one example, the samples may be reconstructed by                left shifting the samples in the palette entries by M                bits.            -   ii. In one example, the reconstructed value may be                (C<<M)+(1<<(M−1)), wherein C is the palette entry.            -   iii. In one example, the samples may be reconstructed by                right shifting the samples in the palette entries by M                bits.            -   iv. In one example, the reconstructed value may be clip                ((C+(1<(M−1)))>>M, 0, (1<<N)−1), wherein C is the                palette entry and N is the bit-depth of reconstruction.            -   v. Alternatively, furthermore, in one example, the M may                depend on the bit depth difference between samples                associated with palette entries and the internal bit                depth of reconstructed samples/original samples.                -   1. In one example, M may be equal to the internal                    bit depth minus the bit depth of samples in the                    palette entries.                -   2. In one example, M may be equal to the bit depth                    of samples in the palette entries minus the internal                    bit depth.                -   3. In one example, M may be equal to the bit depth                    of the original samples minus the bit depth of                    samples in the palette entries.                -   4. In one example, M may be equal to the bit depth                    of samples in the palette entries minus the bit                    depth of the original samples.                -   5. In one example, M may be equal to the bit depth                    of the reconstructed samples minus the bit depth of                    samples in the palette entries,                -   6. In one example, M may be equal to the bit depth                    of samples in the palette entries minus the bit                    depth of the reconstructed samples,            -   vi. In one example, M may be an integer number (e.g.,                2).            -   vii. Alternatively, furthermore, in one example, the M                may depend on:                -   1. Block dimension of current block,                -   2. Current quantization parameter of current block,                -   3. Indication of the color format (such as 4:2:0,                    4:4:4),                -   4. Separate/dual coding tree structure,                -   5. Slice/tile group type and/or picture type,                -   6. Number of palette entries,                -   7. Number of prediction palette entries,                -   8. Sample position in a block/picture/slice/tile,                    and/or                -   9. Index of color component            -   viii. In one example, a look up operation based on the                samples in the palette entries may be used during the                sample's reconstruction.                -   1. In one example, the values in the look up table                    may be signalled in the Sequence Parameter Set                    (SPS)/Video Parameter Set (VPS)/Picture Parameter                    Set (PPS)/picture header/slice header/tile group                    header/LCU row/group of LCUs.                -   2. In one example, the values in the look up table                    may be inferred in the SPS/VPS/PPS/picture                    header/slice header/tile group header/LCU row/group                    of LCUs.    -   13. The signalled/derived quantization parameter (QP) for        palette coded blocks may be firstly modified before being used        to derive escape pixel/samples, such as being clipped.        -   a. In one example, the applied QP range for palette coded            blocks may be treated in the same way as transform skip            mode, and/or BDPCM mode.        -   b. In one example, the applied QP for palette coded blocks            may be revised to be max(Qp, 4+T), where T is an integer            value and Qp is the signalled or derived quantization            parameter for the block.            -   i. In one example, T may be a predefined threshold.            -   ii. In one example, T may be equal to                (4+min_qp_prime_ts_minus4) wherein                min_qp_prime_ts_minus4 may be signalled.    -   14. How to code escape samples/symbols may be unified regardless        whether transquant bypass is enabled or not.        -   a. In one example, escape sample may be signalled with fixed            length.        -   b. In one example, an escape sample may be signalled in            fixed length using N bits.            -   i. In one example, N may be an integer number (e.g., 8                or 10) and may depend on:                -   1. A message signalled in the SPS/VPS/PPS/picture                    header/slice header/tile group header/LCU row/group                    of LCUs,                -   2. Internal bit depth,                -   3. Input bit depth,                -   4. Block dimension of current block,                -   5. Current quantization parameter of current block,                -   6. Indication of the color format (such as 4:2:0,                    4:4:4),                -   7. Separate/dual coding tree structure, and                -   8. Slice/tile group type and/or picture type.        -   c. In one example, the code length to signal an escape            pixel/sample may depend on internal bit depth.            -   i. Alternatively, the code length to signal an escape                pixel/sample may depend on input bit depth.        -   d. In one example, the code length to signal an escape            pixel/sample may depend on the quantization parameter.            -   i. In one example, the code length for signalling an                escape pixel/sample may be f(Qp).                -   1. In one example, the function f may be defined as                    (internal bitdepth −(Qp−4)/6).    -   15. The quantization and/or inverse quantization process for        palette coded blocks and non-palette coded blocks may be defined        in different ways.        -   a. In one example, right bit-shifting may be used for            quantizing escape sample instead of using the quantization            process for transform coefficients or residuals.        -   b. In one example, left bit-shifting may be used for inverse            quantizing escape sample instead of using the inverse            quantization process for transform coefficients or            residuals.        -   c. At the encoder side, the following may apply:            -   i. In one example, the escape pixel/sample value may be                signalled as f(p, Qp), where p is the pixel/sample                value.            -   ii. In one example, the function f may be defined as                p>>((Qp−4)/6), where p is the pixel/sample value and Qp                is the quantization parameter.            -   iii. In one example, the escape pixel/sample value may                be signalled as p>>N, where p is the pixel/sample value.                -   1. In one example, N may be an integer number                    (e.g., 2) and may depend on:                -    a) A message signalled in the SPS/VPS/PPS/picture                    header/slice header/tile group header/LCU row/group                    of LCUs,                -    b) Internal bit depth,                -    c) Input bit depth,                -    d) Block dimension of current block,                -    e) Current quantization parameter of current block,                -    f) Indication of the color format (such as 4:2:0,                    4:4:4),                -    g) Separate/dual coding tree structure, and                -    h) Slice/tile group type and/or picture type.        -   d. At the decoder side, the following may apply:            -   i. In one example, the escape pixel/sample value may be                signalled as f(bd,p,Qp)                -   1. In one example, the function f may be defined as                    clip(0, (1<<(bd−(Qp−4)/6))−1,                    (p+(1<<(bd−1)))>>((Qp−4)/6)).            -   ii. In one example, the escape pixel/sample value may be                reconstructed as f(p,Qp), where p is the decoded escape                pixel/sample value.                -   1. In one example, f may be defined as p<<((Qp−4)/6)            -   iii. In one example, the escape pixel/sample value may                be reconstructed as f(bd,p,Qp), where p is the decoded                escape pixel/sample value.                -   1. In one example, the function clip may be defined                    as clip(0, (1<<bd)−1, p<((Qp−4)/6))            -   iv. In the above examples, the clip function clip(a,i,b)                may be defined as (i<a?a:(i>b?b:i)).            -   v. In the above examples, the clip function clip(a,i,b)                may be defined as (i<=a?a:(i>=b?b:i)).            -   vi. In the above examples, p may be the pixel/sample                value, bd may be the internal bit depth or input bit                depth, and Qp is the quantization parameter.    -   16. A palette-coded block may be treated as an intra block        (e.g., MODE_INTRA) during the list construction process of most        probable modes (MPM).        -   a. In one example, when fetching the intra modes of            neighboring (adjacent or non-adjacent) blocks during the            construction of the MPM list, if a neighboring block (e.g.,            left and/or above) is coded with palette mode, it may be            treated as conventional intra-coded block (e.g., MODE_INTRA)            with a default mode.            -   i. In one example, the default mode may be                DC/PLANAR/VER/HOR mode.            -   ii. In one example, the default mode may be any one                intra prediction mode.            -   iii. In one example, the default mode may be signalled                in the Dependency Parameter Set (DP S)/SPS/VPS/PPS/AP                S/picture header/slice header/tile group header/Largest                coding unit (LCU)/Coding unit (CU)/LCU row/group of                LCUs/TU/PU block/Video coding unit.    -   17. A palette-coded block may be treated as a non-intra block        (e.g., treated as a block with prediction mode equal to        MODE_PLT) during the list construction process of most probable        modes (MPM).        -   a. In one example, when fetching the intra modes of            neighboring blocks during the construction of the MPM list,            if a neighboring block (e.g., left and/or above) is coded            with palette mode, it may be treated in the same way or a            similar way as those coded with inter mode.        -   b. In one example, when fetching the intra modes of            neighboring blocks during the construction of the MPM list,            if a neighboring block (e.g., left and/or above) is coded            with palette mode, it may be treated in the same way or a            similar way as those coded with IBC mode.    -   18. The luma block coded with palette mode corresponding to a        chroma block coded with the DM mode may be interpreted as having        a default intra prediction mode.        -   a. In one example, the corresponding luma block coded with            palette mode may be treated as an intra block (e.g.,            MODE_INTRA) or a palette block (e.g., MODE_PLT) when a            chroma block is coded with the DM mode.        -   b. In one example, the default prediction mode may be            DC/PLANAR/VER/HOR mode.        -   c. In one example, the default prediction mode may be any            one intra prediction mode.        -   d. In one example, the default prediction mode may be            signalled in the decoding parameter set (DPS)/sequence            parameter set (SPS)/video parameter set (VPS)/picture            parameter set (PPS)/adaptation parameter set (APS)/picture            header/slice header/tile group header/largest coding unit            (LCU)/coding unit (CU)/LCU row/group of LCUs/TU/PU            block/video coding unit.    -   19. A palette-coded block may be treated as an unavailable block        during the list construction of history-based motion vector        prediction (HMVP), the merge (MERGE) and/or the advanced motion        vector prediction (AMVP) modes.        -   a. In one example, an unavailable block may denote a block            which does not have any motion information or its motion            information could not be used as a prediction for other            blocks.        -   b. In one example, a block coded with palette mode may be            treated as an intra block (e.g., MODE_INTRA) or a palette            block (e.g., MODE_PLT) in the process of list construction            in HMVP, MERGE and/or AMVP modes.            -   i. Alternatively, in one example, when fetching the                motion information of neighboring blocks during the                construction of the HMVP, MERGE and/or AMVP list, a                neighboring block coded with palette mode may be treated                as a block with an invalid reference index.            -   ii. Alternatively, in one example, when fetching the                motion information of neighboring blocks during the                construction of the HMVP, MERGE and/or AMVP list, a                neighboring block coded with palette mode may be treated                as a inter block with a reference index equal to 0.            -   iii. Alternatively, in one example, when fetching the                motion information of neighboring blocks during the list                construction of the HMVP, MERGE and/or AMVP modes, a                neighboring block coded with palette mode may be treated                as a inter block with a zero-motion vector.    -   20. How to treat a block coded with palette mode (e.g., whether        to and/or how to apply above methods) may be based on:        -   a. Video contents (e.g., screen contents or natural            contents)        -   b. A message signalled in the DPS/SPS/VPS/PPS/APS/picture            header/slice header/tile group header/Largest coding unit            (LCU)/Coding unit (CU)/LCU row/group of LCUs/TU/PU            block/Video coding unit        -   c. Position of CU/PU/TU/block/Video coding unit        -   d. Block dimension of current block and/or its neighboring            blocks        -   e. Block shape of current block and/or its neighboring            blocks        -   f. Indication of the color format (such as 4:2:0, 4:4:4, RGB            or YUV)        -   g. Coding tree structure (such as dual tree or single tree)        -   h. Slice/tile group type and/or picture type        -   i. Color component (e.g., may be only applied on luma            component and/or chroma component)        -   j. Temporal layer ID        -   k. Profiles/Levels/Tiers of a standard    -   21. Context coded bins for palette coded blocks may be        restricted to be within a certain range.        -   a. In one example, a counter is assigned to a block to            record how many bins have been context coded. When the            counter exceeds a threshold, bypass coding is applied            instead of using context coding.            -   i. Alternatively, NumColorComp counters may be assigned                to record how many bins have been context coded for each                color component. NumColorComp is the number of color                components to be coded in one block (e.g., for one CU in                YUV format, NumColorComp is set to 3).            -   ii. Alternatively, a counter may be initialized to be                zero, and after coding one bin with context, the counter                is increased by one.        -   b. Alternatively, a counter may be initialized with some            value greater than zero (e.g., W*H*K) and after coding one            bin with context, the counter is decreased by one. When the            counter is less than or equal to T, bypass coding is applied            instead of using context coding.            -   i. In one example, T is set to 0 or 1.            -   ii. In one example, T is set according to decoded                information or number of coding passes, etc. al.        -   c. In one example, the palette coded blocks may have a same            or different threshold compared with transport stream (TS)            coded blocks or non-TS coded blocks in terms of context            coded bins.            -   i. In one example, a number of context coded bins for a                palette coded block may be set to (W*H*T) wherein W and                H are the width and height of one block, respectively                and T is an integer. In one example, T is set to be the                same as that used for TS coded blocks, such as 1.75 or                2.            -   ii. In one example, a number of context coded bins for a                palette coded block may be set to (W*H*NumColorComp*T)                wherein W and H are the width and height of one block,                respectively; NumColorComp is the number of color                components to be coded in one block (e.g., for one CU in                YUV format, NumColorComp is set to 3). and T is an                integer. In one example, T is set to be the same as that                used for TS coded blocks, such as 1.75 or 2.        -   d. In one example, the threshold of palette-coded blocks may            be smaller than TS coded blocks or non-TS coded blocks in            terms of context coded bins.        -   e. In one example, the threshold of palette-coded blocks may            be larger than TS coded blocks or non-TS coded blocks in            terms of context coded bins.    -   22. A palette-coded block may be treated as a non-intra block        (e.g., treated as a block with prediction mode equal to        MODE_PLT) during the process of counting neighboring intra        blocks in CIIP mode.        -   a. In one example, when fetching the intra modes of            neighboring blocks during counting neighboring intra blocks            in CIIP mode, if a neighboring block (e.g., left and/or            above) is coded with palette mode, it may be treated in the            same way or a similar way as those coded with inter mode.        -   b. In one example, when fetching the intra modes of            neighboring blocks during counting neighboring intra blocks            in CIIP mode, if a neighboring block (e.g., left and/or            above) is coded with palette mode, it may be treated in the            same way or a similar way as those coded with IBC mode.        -   c. Alternatively, a palette-coded block may be treated as an            intra block during the process of counting neighboring intra            blocks in CIIP mode.    -   23. It is proposed to skip the pre- and/or post-filtering        processes for palette coded samples.        -   a. In one example, the palette coded samples may be not            deblocked.        -   b. In one example, the palette coded samples may be not            compensated an offset in the SAO process.        -   c. In one example, the palette coded samples may be not            filtered in the ALF process.            -   i. In one example, the classification in the ALF process                may skip palette coded samples.        -   d. In one example, the LMCS may be disabled for palette            coded samples.    -   24. It is proposed to add more scanning orders in the palette        mode.        -   a. In one example, reverse horizontal transverse scanning            order defined as follows may be used.            -   i. In one example, the scanning direction for the odd                rows may be from left to right.            -   ii. In one example, the scanning direction for the even                rows may be from right to left.            -   iii. In one example, the scanning order for a 4×4 block                may be as shown in FIG. 22 .        -   b. In one example, reverse vertical transverse scanning            order defined as follows may be used.            -   i. In one example, the scanning direction for the odd                rows may be from top to bottom.            -   ii. In one example, the scanning direction for the even                rows may be from bottom to top.            -   iii. In one example, the scanning order for a 4×4 block                may be as shown in FIG. 23 .    -   25. The combination of allowed scanning orders may depend on        block shape.        -   a. In one example, when the ratio between width and height            of a block is larger than a threshold, only horizontal            traverse and reverse horizontal traverse scanning orders may            be applied.            -   i. In one example, the threshold is equal to 1.            -   ii. In one example, the threshold is equal to 4.        -   b. In one example, when the ratio between height and width            of a block is larger than a threshold, only vertical            traverse and reverse vertical traverse scanning orders may            be applied.            -   i. In one example, the threshold is equal to 1.            -   ii. In one example, the threshold is equal to 4.    -   26. It is proposed to only allow one intra prediction direction        and/or one scanning direction in the QR-BDPCM process.        -   a. In one example, only vertical direction is allowed on a            block with width larger than height.        -   b. In one example, only horizontal direction is allowed on a            block with width smaller than height.        -   c. In one example, the indication of direction of QR-BDPCM            may be inferred for a non-square block.            -   i. In one example, furthermore, the indication of                direction of QR-BDPCM may be inferred to vertical                direction for a block with width larger than height.            -   ii. In one example, furthermore, the indication of                direction of QR-BDPCM may be inferred to horizontal                direction for a block with width smaller than height.    -   27. The methods in bullets 24, 25, and 26 may be only applied on        a block with w*Th >=h or h*Th >=w, where w and h are the block        width and height, respectively, and Th is a threshold.        -   a. In one example, Th is an integer number (e.g., 4 or 8)            and may be based on:            -   i. Video contents (e.g., screen contents or natural                contents),            -   ii. A message signalled in the                DPS/SPS/VPS/PPS/APS/picture header/slice header/tile                group header/LCU/CU/LCU row/group of LCUs/TU/PU                block/Video coding unit,            -   iii. Position of CU/PU/TU/block/Video coding unit,            -   iv. Block dimension of current block and/or its                neighboring blocks,            -   v. Block shape of current block and/or its neighboring                blocks,            -   vi. Indication of the color format (such as 4:2:0,                4:4:4, RGB or YUV),            -   vii. Coding tree structure (such as dual tree or single                tree),            -   viii. Slice/tile group type and/or picture type,            -   ix. Color component (e.g., may be only applied on luma                component and/or chroma component),            -   x. Temporal layer ID, and/or            -   xi. Profiles/Levels/Tiers of a standard.

5. Additional Embodiments

In the following embodiments, the newly added texts are bold italicizedand the deleted texts are marked by double square brackets (e.g., [[a]]indicates that ‘a’ is deleted).

5.1 Embodiment 1

This section shows an example embodiment in which the bitstreamrepresentation of video may be changed as compared to the baselinebitstream syntax.

Descriptor seq_parameter_set_rbsp( ) {   sps_max_sub_layers_minus1 u(3)...   sps_gbi_enabled_flag u(1)   sps_ibc_enabled_flag u(1) sps_plt_enabled_flag u(1) ... }sps_plt_enabled_flag equal to 1 specifies that palette mode may he usedin decoding of pictures in the CVS. sps_plt_enabled_flag equal to 0specifies that palette mode is not used in the CVS. Whensps_plt_enahled_flag is not present, it is inferred to be equal to 0.

Descriptor coding_unit( x0, y0, cbWidth, cb Height, treeType ) {    if(tile_group_type != I | | sps_ibc_enabled_flag|| sps_plt_enabled_flag) {    if( treeType!= DUAL_TREE_CHROMA )      cu_skip_flag[ x0 ][ y0 ]ae(v)     if( cu_skip_flag[ x0 ][ y0 ] = = 0 && tile_group_type != I )     pred_mode_flag ae(v)     if( ( ( tile_group_type == I &&cu_skip_flag[ x0 ][ y0 ] ==0 ) ||      ( tile_group_type != I  && CuPredMode[ x0 ][ y0 ] != MODE_INTRA       )      )      &&     (sps_ibc_enabled_flag || sps_plt_enabled_flag)    pred_mode_scc_flag ae(v)   if(scc_mode_flag){   if(sps_ibc_enabled_flag) { ae(v)     pred_mode_ibc_flag    }   if(sps_plt_enabled_flag) {     pred_mode_plt_flag ae(v)    }   }    } ... }pred_mode_scc_flag equal to 1 specifies that the current coding unit iscoded by a screen contnet coding mode.pred_mode_scc_flag equal to 0 specifies that the current coding unit isnot coded by a screen content coding modeWhen pred_mode_see_flag is not present, it is inferred to be equal to 0.pred_mode_plt_flag equal to 1 specifies that the current coding unit iscoded in the palette mode.pred_mode_plt_flag equal to 0 specifies that the current coding unit isnot coded in the palette mode.When pred_mode_plt_flag is not present, it is inferred to be equal tothe value of sps_plt_enabled_flag when decoding an I tile group, and 0when decoding a P or B tile group, respectively.When pred_mode_scc_flag is equal to 1 and sps_ibc_enabled_flag is equalto 0, the pred_mode_plt_flag is inferred to be equal to 1.When pred_mode_ibc_flag is equal to 1, the variable CuPredModef[x][y] isset to be equal to MODE_PLT for x=x0 . . . x0+cbWidth−1 and y=y0 . . .y0+cbHeight−1.

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {  if(tile_group_type != I | | sps_ibc_enabled_flag || sps_plt_enabled_flag ){   if( treeType != DUAL_TREE_CHROMA )    cu_skip_flag[ x0 ][ y0 ] ae(v)  if( cu_skip_flag[ x0 ][ y0 ] = = 0 && tile_group_type != I )   pred_mode_flag ae(v)   if( ( ( tile_group_type = = I && cu_skip_flag[x0 ][ y0 ] = =0 ) | |    ( tile_group_type != I && CuPredMode[ x0 ][ y0] != MODE_INTRA       )      )     &&    (sps_ibc_enabled_flag)    pred_mode_ibc_flag ae(v) if( ( ( tile_group_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | |    ( tile_group_type !=I && CuPredMode[ x0 ][ y0 ] != MODE_INTRA       )      )     &&   sps_plt_enabled_flag               &&    CuPredMode[ x0 ][ y0 ] !=MODE_IBC     pred_mode_plt_flag ae(v)   }  ... }

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {  if(tile_group_type != I | | sps_ibc_enabled_flag || sps_plt_enabled_flag ){   if( treeType != DUAL_TREE_CHROMA )    cu_skip_flag[ x0 ][ y0 ] ae(v)  if( cu_skip_flag[ x0 ][ y0 ] = = 0 && tile_group_type != I )   pred_mode_flag ae(v)   if( ( ( tile_group_type = = I && cu_skip_flag[x0 ][ y0 ] = =0 ) | |    ( tile_group_type != I && CuPredMode[ x0 ][ y0] != MODE_INTRA       )       )      &&    (sps_ibc_enabled_flag)   pred_mode_ibc_flag ae(v) if(  CuPredMode[ x0 ][ y0]  ==  MODE_INTRA   &&    sps_plt_enabled_flag )     pred_mode_plt_flagae(v)   }  ... }pred_mode_plt_flag equal to 1 specifies that the current coding unit iscoded in the palette mode.pred_mode_plt_flag equal to 0 specifies that the current coding unit isnot coded in the palette mode.When pred_mode_plt_flag is not present, it is inferred to be equal tothe value of sps_plt_enabled_flag when decoding an I tile group, and 0when decoding a P or B tile group, respectively.When pred_mode_ibc_flag is equal to 1, the variable CuPredModef[x][y] isset to be equal to MODE_PLT for x=x0 . . . x0+cbWidth−1 and y=y0 . . .y0+cbHeight−1.

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {  if(tile_group_type != I | | sps_ibc_enabled_flag || sps_plt_enabled_flag ){   if( treeType != DUAL_TREE_CHROMA )    cu_skip_flag[ x0 ][ y0 ] ae(v)  if( cu_skip_flag[ x0 ][ y0 ] = = 0 && tile_group_type != I )   pred_mode_flag ae(v)   if( ( ( tile_group_type = = I && cu_skip_flag[x0 ][ y0 ] = =0 ) | |    ( tile_group_type != I && CuPredMode[ x0 ][ y0] == MODE_INTRA       )       )      &&    (sps_ibc_enabled_flag)   pred_mode_ibc_flag if( ( ( tile_group_type = = I && cu_skip_flag[ x0][ y0 ] = =0 ) | | ae(v)    ( tile_group_type != I && CuPredMode[ x0 ][y0 ] == MODE_INTRA && (sps_ibc_enabled_flag? CuPredMode[ x0 ][ y0 ] !=MODE_IBC : TRUE)         )        )       &&    sps_plt_enable_flag )  pred_mode_plt_flag ae(v)   }  ... }pred_mode_plt_flag equal to 1 specifies that the current coding unit iscoded in the palette mode.pred_mode_plt_flag equal to 0 specifies that the current coding unit isnot coded in the palette mode.When pred_mode_plt_flag is not present, it is inferred to be equal tothe value of sps_plt_enabled_flag when decoding an I tile group, and 0when decoding a P or B tile group, respectively.When pred_mode_ibc_flag is equal to 1, the variable CuPredModef[x][y] isset to be equal to MODE_PLT for x=x0 . . . x0+cbWidth−1 and y=y0 . . .y0+cbHeight−1.

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType ) {  if(tile_group_type != I | | sps_ibc_enabled_flag || sps_plt_enabled_flag ){   if( treeType != DUAL_TREE_CHROMA )    cu_skip_flag[ x0 ][ y0 ] ae(v)  if( cu_skip_flag[ x0 ][ y0 ] = = 0 )    pred_modes(x0, y0, cbWidth,cbHeight)  ... }

Descriptor pred_modes ( x0, y0, cbWidth, cbHeight) {   if(tile_group_type == I ) {     if(sps_ibc_enabled_flag)     pred_mode_ibc_flag ae(v)     if(CuPredMode[ x0 ][ y0 ] !=MODE_IBC){      if(sps_plt_enabled_flag && cbWidth <=64 && cbHeight <=64)      plt_mode_flag ae(v)    }    else{      pred_mode_flag ae(v)    if(CuPredMode[ x0 ][ y0 ] == MODE_INTRA || (CuPredMode[ x0 ][ y0 ]!= MODE_INTRA && ! sps_ibc_enabled_flag)){      if(sps_plt_enabled_flag&& cbWidth <=64 && cbHeight <= 64)       plt_mode_flag ae(v)     }  else{      if(sps_ibc_enabled_flag)      pred_mode_ibc_flag ae(v)    } } }

Descriptor pred_modes ( x0, y0, cbWidth, cbHeight) {   if(tile_group_type == I ) {     if(sps_ibc_enabled_flag ||sps_plt_enabled_flag)      pred_mode_flag ae(v)     if(CuPredMode[ x0 ][y0 ] != MODE_INTRA){      if(sps_plt_enabled_flag && cbWidth <=64 &&cbHeight <= 64)      plt_mode_flag ae(v)    }    else{     pred_mode_flag ae(v)     if(CuPredMode[ x0 ][ y0 ] == MODE_INTRA ||(CuPredMode[ x0 ][ y0 ] != MODE_INTRA && ! sps_ibc_enabled_flag)){     if(sps_plt_enabled_flag && cbWidth <=64 && cbHeight <= 64)      plt_mode_flag ae(v)     }   else{      if(sps_ibc_enabled_flag)     pred_mode_ibc_flag ae(v)    }  } }

Descriptor pred_modes ( x0, y0, cbWidth, cbHeight) {   if(tile_group_type == I ) {     if(sps_ibc_enabled_flag ||sps_plt_enabled_flag)      pred_mode_flag ae(v)     if(CuPredMode[ x0 ][y0 ] != MODE_INTRA){      if(sps_plt_enabled_flag && cbWidth <=64 &&cbHeight <= 64)      plt_mode_flag ae(v)    }    else{     pred_mode_flag ae(v)     if(CuPredMode[ x0 ][ y0 ] == MODE_INTRA ||(CuPredMode[ x0 ][ y0 ] != MODE_INTRA && ! sps_ibc_enabled_flag)){     if(sps_plt_enabled_flag && cbWidth <=64 && cbHeight <= 64)      plt_mode_flag ae(v)     }   else{      if(sps_ibc_enabled_flag)     pred_mode_ibc_flag ae(v)    }  } }

Descriptor pred_modes ( x0, y0, cbWidth, cbHeight) {   if(tile_group_type == I ) {     if(sps_ibc_enabled_flag ||sps_plt_enabled_flag)      pred_mode_flag ae(v)     if(CuPredMode[ x0 ][y0 ] != MODE_INTRA){      if(sps_plt_enabled_flag)      plt_mode_flagae(v)    }    else{      pred_mode_flag ae(v)     if(CuPredMode[ x0 ][y0 ] == MODE_INTRA || (CuPredMode[ x0 ][ y0 ] != MODE_INTRA && !sps_ibc_enabled_flag)){      if(sps_plt_enabled_flag)      plt_mode_flag ae(v)     }   else{      if(sps_ibc_enabled_flag)     pred_mode_ibc_flag ae(v)    }  } }plt_mode_flag equal to 1 specifies that the current coding unit is codedin palette mode. intra_mode_plt_flag equal to 0 specifies that thecurrent coding unit is coded in the palette mode.When plt_mode_flag is not present, it is inferred to be equal to false.When pred_mode_scc_flag is equal to 1, the variable CuPredMode[x][y] isset to be equal to MODE_PLT for x=x0 . . . x0+cbWidth−1 and y=y0 . . .y0+cbHeight−1.pred_mode_flag equal to 0 specifies that the current coding unit iscoded in inter prediction mode or IBC prediction mode, pred_mode_flagequal to 1 specifies that the current coding unit is coded in intraprediction mode or PLT mode. The variable CuPredMode[x][y] is derived asfollows for x=x0 . . . x0+cbWidth−1 and y=y0 . . . y0+cbHeight−1:

-   -   If pred_mode_flag is equal to 0, CuPredMode[x][y] is set equal        to MODE_INTER.    -   Otherwise (pred_mode_flag is equal to 1), CuPredMode[x][y] is        set equal to MODE_INTRA.        When pred_mode_flag is not present, it is inferred to be equal        to 1 when decoding an I tile group, and equal to 0 when decoding        a P or H tile group, respectively.

TABLE 9-4 Syntax elements and associated binarization. SyntaxBinarization structure Syntax element process Input parameterpred_modes( ) PLT_mode_flag FL cMax = 1

TABLE 9-10 Assignment of ctxInc to syntax elements with context codedbins binIdx Syntax element 0 1 2 3 4 >=5 PLT_mode_flag 0 na na na na na

5.2 Embodiment #2

This embodiment describes the modeType.

A variable modeType specifying whether Intra, IBC, Pallette and Intercoding modes can be used (MODE_TYPE_ALL), or whether only Intra,Pallette and IBC coding modes can be used (MODE_TYPE_INTRA), or whetheronly Inter coding modes can be used (MODE_TYPE_INTER) for coding unitsinside the coding tree node.

5.3 Embodiment #3

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag is signalled after the pred_mode_ibc_flag.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I | | sps_ibc_enabled flag | |sps_plt_enabled_flag ) {   if(   treeType   !=   DUAL_TREE_CHROMA     &&     !(   [[cbWidth  ==  4  &&  cbHeight  = =  4 && !sps_ibc_enabled_flag) ]]  ( ( cbWidth = =4 && cbHeight = = 4 ) | | modeType = = MODE_TYPE_INTRA )     &&!sps_ibc_enabled_flag ))     cu_skip_flag[ x0 ][ y0 ] ae(v)    if(  cu_skip_flag[ x0 ][ y0 ]  = =  0  &&  slice_type  !=  I     && !(cbWidth = = 4 && cbHeight = = 4 ) && modeType = = MODE_TYPE_ALL)    pred_mode_flag ae(v)    [[if(  (  (  slice_type  == I  && cu_skip_flag[ x0 ][ y0 ] = =0  ) | |     (  slice_type  != I && ( CuPredMode[ x0 ][ y0 ] !=  MODE_INTRA | |     ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0     )      )      )      )     &&     sps_ibc_enabled_flag && (cbWidth != 128 | | cbHeight != 128 ) )[[==]]    if(  (  (  slice_type ==  I  &&  cu_skip_flag[ x0 ][ y0 ]  = =0  ) | |     (  slice_type  != I  &&   ( CuPredMode[ x0 ][ y0 ]  != MODE_INTRA | |     ( cbWidth = = 4&& cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0     )      )      )      )    &&     cbWidth <= 64 && cbHeight<= 64 ) &&  modeType != MODE_TYPE_INTER ) {    if(    sps_ibc_enabled_flag    &&    treeType    != DUAL_TREE_CHROMA)      pred_mode_ibc_flag ae(v)  }  if( CuPredMode[ x0 ][ y0 ] ==MODE_INTRA || (slice_type != I && !(cbWidth = = 4   && cbHeight == 4 )&& !sps_ibc_enabled_flag && CuPredMode[ x0 ][ y0 ] !=   MODE_INTRA )) &&cbWidth <= 64 && cbHeight <= 64 && sps_plt_enabled_flag   &&cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType != MODE_INTER)     pred_mode_plt_flag ae(v)  } ... }

5.4 Embodiment #4

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag is signalled after the pred_mode_ibc_flag and thepred_mode_plt_flag is signalled only when the current prediction mode isMODE_INTRA.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType) {  if( slice_type != I | | sps_ibc_enabled flag | | sps_plt_enabled_flag) {    if(   treeType   !=   DUAL_TREE_CHROMA     &&    !(  [[cbWidth  = =  4  &&  cbHeight  = =  4 && !sps_ibc_enabled_flag) ]]  ( ( cbWidth = = 4 && cbHeight = = 4 ) | | modeType = =MODE_TYPE_INTRA )     && !sps_ibc_enabled_flag ))     cu_skip_flag[ x0][ y0 ] ae(v)    if(   cu_skip_flag[ x0 ][ y0 ]  ==  0  &&  slice_type  !=  I     && !( cbWidth = = 4 && cbHeight = = 4 )&& modeType = = MODE_TYPE_ALL)     pred_mode_flag ae(v) [[   if(  (  ( slice_type = = I && cu_skip_flag[ x0 ][ y0 ] = =0  ) | |     (slice_type  != I && ( CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |     (cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0     )     )     )     )     &&     sps_ibc_enabled_flag && (cbWidth != 128 | | cbHeight != 128 ) )]]    if(  (  (  slice_type = =  I &&  cu_skip_flag[ x0 ][y0 ]  = =0  ) | |     ( slice_type  != I  && (CuPredMode[ x0 ][ y0 ]  !=  MODE_INTRA | |     ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0     )     )     )     )     &&     cbWidth <= 64 && cbHeight <=64 ) &&  modeType != MODE_ TYPE_INTER ) {    if(   sps_ibc_enabled_flag   &&   treeType   != DUAL_TREE_CHROMA )     pred_mode_ibc_flag ae(v)  }    if(cu_skip_flag[ x0 ][ y0 ] = = 0 &&CuPredMode[ x0 ][ y0 ] == MODE_INTRA &&   cbWidth <= 64 && cbHeight <=64 && sps_plt_enabled_flag && modeType !=   MODE_TYPE_INTER )      pred_mode_plt_flag ae(v)  } ... }

5.5 Embodiment #5

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_ibc_flag is signalled after the pred_mode_plt_flag.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I | | sps_ibc_enabled_flag | |sps_plt_enabled_flag ) {    if(  treeType  !=  DUAL_TREE_CHROMA  &&    !( [[cbWidth  = =  4  &&  cbHeight  = =  4 && !sps_ibc_enabled_flag) ]]  ( ( cbWidth = = 4 && cbHeight = = 4 ) | | modeType = =MODE_TYPE_INTRA )     && !sps_ibc_enabled_flag ))     cu_skip_flag[ x0][ y0 ] ae(v)    if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I    && !( cbWidth = = 4 && cbHeight = = 4 ) && modeType = =MODE_TYPE_ALL)     pred_mode_flag ae(v)   [[ if( ( ( slice_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | |     ( slice_type != I && (CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |     ( cbWidth = = 4 && cbHeight= = 4 && cu_skip_flag[ x0 ][ y0 ] = =    0    )    )    )    )     &&    sps_ibc_enabled_flag && ( cbWidth != 128 | | cbHeight != 128 ) ) ]]   if( CuPredMode[ x0 ][ y0 ] == MODE_INTRA || (slice_type != I &&!(cbWidth = = 4  && cbHeight = = 4 ) && !sps_ibc_enabled_flag &&CuPredMode[ x0 ][ y0 ] !=  MODE_INTRA )) && cbWidth <= 64 && cbHeight <=64 && sps_plt_enabled_flag  && cu_skip_flag[ x0 ][ y0 ] = = 0 &&modeType != MODE_INTER)      pred_mode_plt_flag ae(v)    if( ( (slice_type = = I && cu_skip_flag[ x0 ][ y0 ] = =0 ) | |     ( slice_type!= I && ( CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |     ( cbWidth = = 4&& cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==    0    )    )    )    )     &&     cbWidth <= 64 && cbHeight <= 64 )&&   modeType != MODE_TYPE_INTER ) {    if( sps_ibc_enabled_flag   &&   treeType   != DUAL_TREE_CHROMA )     pred_mode_ibc_flag ae(v)  }  } ... }

5.6 Embodiment #6

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_ibc_flag is signalled after the pred_mode_plt_flag and thepred_mode_plt_flag is signalled only when the current prediction mode isMODE_INTRA.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType) {  if( slice_type != I | | sps_ibc_enabled_flag | | sps_plt_enabled_flag) {    if(   treeType  !=  DUAL_TREE_CHROMA   &&     !(  [[cbWidth  ==  4 && cbHeight  = =  4 && !sps_ibc_enabled_flag ) ]]  ( ( cbWidth = =4 && cbHeight = = 4 ) | | modeType = = MODE_TYPE_INTRA )     &&!sps_ibc_enabled_flag ))     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I     && !(cbWidth = = 4 && cbHeight = = 4 ) && mode Type = = MODE_TYPE_ALL)    pred_mode_flag ae(v)    if cu_skip_flag[ x0 ][ y0 ] = = 0 &&(CuPredMode[ x0 ][ y0 ] == MODE_INTRA &&  cbWidth <= 64 && cbHcight <=64 && sps_plt_enabled_flag && modeType !=  MODE_TYPE_INTER )     pred_mode_plt_flag ae(v)  } [[   if( ( ( slice_type = =I && cu_skip_flag[ x0 ][ y0 ] = =0 ) | |      ( slice_type != I && (CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |      ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==    0    )    )     )     )    &&      sps_ibc_enabled_flag && (cbWidth != 128 | | cbHeight != 128 ) )]]     if( ( ( slice_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | |      ( slice_type != I && (CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |      ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0    )    )    )    )     &&      cbWidth <= 64 && cbHeight <= 64) &&   modeType != MODE_TYPE_INTER ) {     if(   sps_ibc_enabled_flag  &&  treeType   != DUAL_TREE_CHROMA )      pred_mode_ibc_flag ae(v)   }  } ... }

5.7 Embodiment #7

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag and pred_mode_ibc_flag are signalled when theprediction mode is MODE_INTRA.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I | | sps_ibc_enabled_flag | |sps_plt_enabled_flag ) {    if(  treeType  !=  DUAL_TREE_CHROMA  &&    !( [[cbWidth = = 4 && cbHeight = = 4 && !sps_ibc_enabled_flag ) ]] ( ( cbWidth = = 4 && cbHeight = = 4 ) | | modeType = = MODE_TYPE_INTRA)     && !sps_ibc_enabled_flag ))     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I     && !(cbWidth = = 4 && cbHeight = = 4 ) && modeType = = MODE_TYPE_ALL)    pred_mode_flag ae(v) [[  if( ( ( slice_type = = I && cu_skip_flag[x0 ][ y0 ] = =0 ) | |     ( slice_type != I && ( CuPredMode[ x0 ][ y0 ]!= MODE_INTRA | |     ( cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[x0 ][ y0 ] = =     0    )    )    )    )    &&     sps_ibc_enabled_flag&& ( cbWidth != 128 | | cbHeight != 128 ) )]]     if( ( ( slice_type = =I && cu_skip_flag[ x0 ][ y0 ] = =0 ) | |      ( slice_type != I && (CuPredMode[ x0 ][ y0 ] == MODE_INTRA | |      ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0    )    )    )    )    &&      cbWidth <= 64 && cbHeight <= 64 )&& modeType != MODE_TYPE_INTER ) {     if(  sps_ibc_enabled_flag  &&  treeType  != DUAL_TREE_CHROMA )     pred_mode_ibc_flag ae(v)  }  if( CuPredMode[ x0 ][ y0 ] ==MODE_INTRA && cbWidth <= 64 && cbHeight <= 64   && sps_plt_enabled_flag&& cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType !=   MODE_INTER)      pred_mode_plt_flag ae(v)  } ... }

5.8 Embodiment #8

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag and pred_mode_ibc_flag are signalled when theprediction mode is not MODE_INTRA.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I | | sps_ibc_enabled_flag | |sps_plt_enabled_flag ) {    if(  treeType   !=   DUAL_TREE_CHROMA   &&    !(  [[cbWidth  = =  4  &&  cbHeight  = =  4 && !sps_ibc_enabled_flag) ]]  ( ( cbWidth = = 4 && cbHeight = = 4 ) | | modeType = =MODE_TYPE_INTRA )     && !sps_ibc_enabled_flag ))     cu_skip_flag[ x0][ y0 ] ae(v)    if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I    && !( cbWidth = = 4 && cbHcight = = 4 ) && modeType = =MODE_TYPE_ALL)     pred_mode_flag ae(v) [[   if( ( ( slice_type = = I &&cu_skip_flag[ x0 ][ y0 ] = =0 ) | |     ( slice_type != I && (CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |     ( cbWidth = = 4 && cbHeight= = 4 && cu_skip_flag[ x0 ][ y0 ] = =    0    )    )    )    )    &&    sps_ibc_enabled_flag && ( cbWidth != 128 | | cbHeight != 128 ) )]]   if( ( ( slice_type = = I && cu_skip_flag[ x0 ][ y0 ] = =0 ) | |     (slice_type != I && ( CuPredMode[ x0 ][ y0 ] != MODE_INTRA | |     (cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==    0    )    )    )    )    &&     cbWidth <= 64 && cbHeight <= 64 )&&  modeType != MODE_TYPE_INTER ) {    if(  sps_ibc_enabled_flag  &&  treeType  != DUAL_TREE_CHROMA )     pred_mode_ibc_flag ae(v)  }  if( CuPredMode[ x0 ][ y0 ] !=MODE_INTRA && cbWidth <= 64 && cbHeight <= 64   && sps_plt_enabled_flag&& cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType !=   MODE_INTER)      pred_mode_plt_flag ae(v)  } ... }

5.9 Embodiment #9

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag and pred_mode_ibc_flag are signalled when theprediction mode is MODE_INTER.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){  if( slice_type != I || sps_ibc_enabled_flag || sps_plt_enabled_flag ){   if(  treeType  !=  DUAL_TREE_CHROMA  &&    !(  [[cbWidth  == 4 &&  cbHeight = = 4 && !sps_ibc_enabled_flag ) ]]  ( ( cbWidth = = 4&& cbHeight = = 4 ) || modeType = = MODE_TYPE_INTRA )    &&!sps_ibc_enabled_flag ))    cu_skip_flag[ x0 ][ y0 ] ae(v)  if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I    && !( cbWidth= = 4 && cbHeight = = 4 ) && modeType = = MODE_TYPE_ALL)   pred_mode_flag ae(v) [[  if( ( ( slice_type = = I && cu_skip_flag[ x0][y0 ] = =0 ) ||    ( slice_type != I && ( CuPredMode[ x0 ][ y0 ] !=MODE_INTRA ||    ( cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[ x0][ y0 ] = =    0    )    )    )    )    &&    sps_ibc_enabled_flag && (cbWidth != 128 || cbHeight != 128 ) )]]   if( ( ( slice_type = =I && cu_skip_flag[ x0 ][ y0 ] = =0 ) ||   ( slice_type != I && ( CuPredMode[ x0 ][ y0 ] == MODE_INTER    (cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==    0    )    )    )    )    &&    cbWidth <= 64 && cbHeight <= 64)&&   modeType != MODE_TYPE_INTER ) {   if(  sps_ibc_enabled_flag  &&  treeType  != DUAL_TREE_CHROMA )    pred_mode_ibc_flag ae(v)  }  if( CuPredMode[ x0 ][ y0 ] ==MODE_INTER && cbWidth <= 64 && cbHeight <= 64   && sps_plt_enabled_flag&& cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType !=   MODE_INTER)     pred_mode_plt_flag ae(v)  } ... }

5.10 Embodiment #10

This embodiment describes the semantic of the pred_mode_plt_flag.

pred_mode_plt_flag specifies the use of palette mode in the currentcoding unit, pred_mode_plt_flag==1 indicates that palette mode isapplied in the current coding unit, pred_mode_plt_flag==0 indicates thatpalette mode is not appliedfor the current coding unit. Whenpred_mode_plt_flag is not present, it is inferred to be equal to 0.

5.11 Embodiment #11

This embodiment describes the semantic of the pred_mode_plt_flag.

pred_mode_plt_flag specifies the use of palette mode in the currentcoding unit, pred_mode_plt_flag==1 indicates that palette mode isapplied in the current coding unit, pred_mode_plt_flag==0 indicates thatpalette mode is not applied for the current coding unit. Whenpred_mode_plt_flag is not present, it is inferred to be equal to 0.When pred_mode_scc_flag is equal to 1, the variable CuPredMode[x][y] isset to be equal to MODE_PLT for x=x0 . . . x0+cbWidth−1 and y=y0 . . .y0+cbHeight−1.

5.12 Embodiment #12

This embodiment describes the boundary strength derivation.

8.8.3.5 Derivation Process of Boundary Filtering Strength

Inputs to this process are:a picture sample array recPicture,a location (xCb, yCb) specifying the top-left sample of the currentcoding block relative to the top-left sample of the current picture,a variable nCbW specifying the width of the current coding block,a variable nCbH specifying the height of the current coding block,a variable edgeType specifying whether a vertical (EDGE_VER) or ahorizontal (EDGE_HOR) edge is filtered,a variable cIdx specifying the colour component of the current codingblock,a two-dimensional (nCbW)×(nCbH) array edgeFlags.Output of this process is a two-dimensional (nCbW)×(nCbH) array bSspecifying the boundary filtering strength.The variable bS[xD_(i)][yD_(j)] is derived as follows:If cIdx is equal to 0 and both samples p₀ and q₀ are in a coding blockwith intra_bdpcm_flag equal to 1, bS[xD_(i)][yD_(j)] is set equal to 0.Otherwise, if the sample p₀ or q₀ is in the coding block of a codingunit coded with intra prediction mode, bS[xD_(i)][yD_(j)] is set equalto 2.Otherwise, if the block edge is also a transform block edge and thesample p₀ or q₀ is in a coding block with ciip_flag equal to 1,bS[xD_(i)][yD_(j)] is set equal to 2.Otherwise, if the block edge is also a transform block edge and thesample p₀ or q₀ is in a transform block which contains one or morenon-zero transform coefficient levels, bS[xD_(i)][yD_(j)] is set equalto 1.Otherwise, if the block edge is also a transform block edge and thesample p₀ and q₀ are in two coding blocks with pred_mode_plt_flag equalto 1, bS[xD_(i)][yD_(j)] is set equal to 0.Otherwise, if the prediction mode of the coding subblock containing thesample p₀ is different from the prediction mode of the coding subblockcontaining the sample q₀, bS[xD_(i)][yD_(j)] is set equal to 1.Otherwise, if cIdx is equal to 0 and one or more of the followingconditions are true, bS[xD_(i)][yD_(j)] is set equal to 1: The codingsubblock containing the sample p₀ and the coding subblock containing thesample q₀ are both coded in IBC prediction mode, and the absolutedifference between the horizontal or vertical component of the motionvectors used in the prediction of the two coding subblocks is greaterthan or equal to 4 in units of quarter luma samples. For the predictionof the coding subblock containing the sample p₀ different referencepictures or a different number of motion vectors are used than for theprediction of the coding subblock containing the sample q₀.NOTE 1—The determination of whether the reference pictures used for thetwo coding sublocks are the same or different is based only on whichpictures are referenced, without regard to whether a prediction isformed using an index into reference picture list 0 or an index intoreference picture list 1, and also without regard to whether the indexposition within a reference picture list is different.NOTE 2—The number of motion vectors that are used for the prediction ofa coding subblock with top-left sample covering (xSb, ySb), is equal toPredFlagL0[xSb][ySb]+PredFlagL1[xSb][ySb]. One motion vector is used topredict the coding subblock containing the sample p₀ and one motionvector is used to predict the coding subblock containing the sample q₀,and the absolute difference between the horizontal or vertical componentof the motion vectors used is greater than or equal to 4 in units ofquarter luma samples. Two motion vectors and two different referencepictures are used to predict the coding subblock containing the samplep₀, two motion vectors for the same two reference pictures are used topredict the coding subblock containing the sample q₀ and the absolutedifference between the horizontal or vertical component of the twomotion vectors used in the prediction of the two coding subblocks forthe same reference picture is greater than or equal to 4 in units ofquarter luma samples.Two motion vectors for the same reference picture are used to predictthe coding subblock containing the sample p₀, two motion vectors for thesame reference picture are used to predict the coding subblockcontaining the sample q₀ and both of the following conditions are true:The absolute difference between the horizontal or vertical component oflist 0 motion vectors used in the prediction of the two coding subblocksis greater than or equal to 4 in quarter luma samples, or the absolutedifference between the horizontal or vertical component of the list 1motion vectors used in the prediction of the two coding subblocks isgreater than or equal to 4 in units of quarter luma samples.The absolute difference between the horizontal or vertical component oflist 0 motion vector used in the prediction of the coding subblockcontaining the sample p₀ and the list 1 motion vector used in theprediction of the coding subblock containing the sample q₀ is greaterthan or equal to 4 in units of quarter luma samples, or the absolutedifference between the horizontal or vertical component of the list 1motion vector used in the prediction of the coding subblock containingthe sample p₀ and list 0 motion vector used in the prediction of thecoding subblock containing the sample q₀ is greater than or equal to 4in units of quarter luma samples.Otherwise, the variable bS[xD_(i) yD_(j)] is set equal to 0.

5.13a Embodiment #13a

This embodiment describes the boundary strength derivation

8.8.3.5 Derivation Process of Boundary Filtering Strength

Inputs to this process are:a picture sample array recPicture,a location (xCb, yCb) specifying the top-left sample of the currentcoding block relative to the top-left sample of the current picture,a variable nCbW specifying the width of the current coding block,a variable nCbH specifying the height of the current coding block,a variable edgeType specifying whether a vertical (EDGE_VER) or ahorizontal (EDGE_HOR) edge is filtered,a variable cIdx specifying the colour component of the current codingblock,a two-dimensional (nCbW)×(nCbH) array edgeFlags.Output of this process is a two-dimensional (nCbW)×(nCbH) array bSspecifying the boundary filtering strength.The variable bS[xD][yD_(j)] is derived as follows:If cIdx is equal to 0 and both samples p₀ and q₀ are in a coding blockwith intra_bdpcm_flag equal to 1, bS[xD_(i)][yD_(j)] is set equal to 0.Otherwise, if the sample p₀ or q₀ is in the coding block of a codingunit coded with intra prediction mode, bS[xD_(i) yD_(j)] is set equal to2.Otherwise, if the block edge is also a transform block edge and thesample p₀ or q₀ is in a coding block with ciip_flag equal to 1,bS[xD_(i) yD_(j)] is set equal to 2.Otherwise, if the block edge is also a transform block edge and thesample p₀ or q₀ is in a transform block which contains one or morenon-zero transform coefficient levels, bS[xD_(i)][yD_(j)] is set equalto 1.Otherwise, if the block edge is also a transform block edge and thesample p₀ and q₀ are in two coding blocks with pred_mode_plt_flag equalto 1, bS[xD_(i)][yD_(j)] is set equal to 0.Otherwise, if the prediction mode of the coding subblock containing thesample p₀ is different from the prediction mode of the coding subblockcontaining the sample q₀, bS[xD_(i)][yD_(j)] is set equal to 1.Otherwise, if cIdx is equal to 0 and one or more of the followingconditions are true, bS[xD_(i)][yD_(j)] is set equal to 1: The codingsubblock containing the sample p₀ and the coding subblock containing thesample q₀ are both coded in IBC prediction mode, and the absolutedifference between the horizontal or vertical component of the motionvectors used in the prediction of the two coding subblocks is greaterthan or equal to 4 in units of quarter luma samples.For the prediction of the coding subblock containing the sample p₀different reference pictures or a different number of motion vectors areused than for the prediction of the coding subblock containing thesample q₀.NOTE 1—The determination of whether the reference pictures used for thetwo coding sublocks are the same or different is based only on whichpictures are referenced, without regard to whether a prediction isformed using an index into reference picture list 0 or an index intoreference picture list 1, and also without regard to whether the indexposition within a reference picture list is different.NOTE 2—The number of motion vectors that are used for the prediction ofa coding subblock with top-left sample covering (xSb, ySb), is equal toPredFlagL0[xSb][ySb]+PredFlagL1[xSb][ySb].One motion vector is used to predict the coding subblock containing thesample p₀ and one motion vector is used to predict the coding subblockcontaining the sample q₀, and the absolute difference between thehorizontal or vertical component of the motion vectors used is greaterthan or equal to 4 in units of quarter luma samples.Two motion vectors and two different reference pictures are used topredict the coding subblock containing the sample p₀, two motion vectorsfor the same two reference pictures are used to predict the codingsubblock containing the sample q₀ and the absolute difference betweenthe horizontal or vertical component of the two motion vectors used inthe prediction of the two coding subblocks for the same referencepicture is greater than or equal to 4 in units of quarter luma samples.Two motion vectors for the same reference picture are used to predictthe coding subblock containing the sample p₀, two motion vectors for thesame reference picture are used to predict the coding subblockcontaining the sample q₀ and both of the following conditions are true:The absolute difference between the horizontal or vertical component oflist 0 motion vectors used in the prediction of the two coding subblocksis greater than or equal to 4 in quarter luma samples, or the absolutedifference between the horizontal or vertical component of the list 1motion vectors used in the prediction of the two coding subblocks isgreater than or equal to 4 in units of quarter luma samples.The absolute difference between the horizontal or vertical component oflist 0 motion vector used in the prediction of the coding subblockcontaining the sample p₀ and the list 1 motion vector used in theprediction of the coding subblock containing the sample q₀ is greaterthan or equal to 4 in units of quarter luma samples, or the absolutedifference between the horizontal or vertical component of the list 1motion vector used in the prediction of the coding subblock containingthe sample p₀ and list 0 motion vector used in the prediction of thecoding subblock containing the sample q₀ is greater than or equal to 4in units of quarter luma samples.Otherwise, the variable bS[xD_(i)][yD_(j)] is set equal to 0.

5.13b Embodiment #13b

This embodiment describes escape samples coding and reconstruction.

Descriptor palette_coding( x0, y0, cbWidth, cbHeight, startComp,numComps ) { ... /* Parsing escape values */  if(palette_escape_val_present_flag ) {   for( cIdx = startComp; cIdx < (startComp + numComps ); cIdx++ )    for( sPos = 0; sPos < ebWidth*cbHeight; sPos++ ) {     xC                        = TraverseScanOrder[cbWidth][ cbHeight ][ sPos ][ 0 ]     yC                        =TraverseScanOrder[ cbWidth][ cbHeight ][ sPos ][ 1 ]     if(PaletteIndexMap[ cIdx ]    [ xC ][ yC ]    = = ( MaxPaletteIndex − 1 ) ){      palette_escape_val [[ae(v) ]]u(v)      PaletteEscapeVal[ cIdx ][xC ][ yC ]          = palette_escape_val    }   }  } }Decoding process for palette modeInputs to this process are:a location (xCb,yCh) specifying the top-left luma sample of the currentblock relative to the top-left luma sample of the current picture,a variable startComp specifies the first colour component in the palettetable,a variable cIdx specifying the colour component of the current block,two variables nCbW and nCbH specifying the width and height of thecurrent block, respectively.Output of this process is an array recSamples[x][y], with x=0 . . .nCbW−1, y=0 . . . nCbH−1 specifying reconstructed sample values for theblock.Depending on the value of cIdx, the variables nSubWidth and nSubHeightare derived as follows:If cIdx is equal to 0, nSubWidth is set to 1 and nSubHeight is set to 1.Otherwise, nSubWidth is set to SubWidthC and nSubHeight is set toSubHeightC.The (nCbW×nCbH ) block of the reconstructed sample array recSamples atlocation (xCb,yCb) is represented by recSamples[x][y], with x=0 . . .nCbW−1, y=0 . . . nCbH−1, and the value of array recSamples[x][y] foreach x in the range of 0 to nCW−1, inclusive, and each y in the range of0 to nCbH−1, inclusive, is derived as follows:The variables xL and yL are derived as follows:

xL=palette_transpose_flag?x*nSuhHeight:x*nSubWidth   (8-69)

yL=palette_transpose_flag?y*nSuhHeight:y*nSubWidth   (8-70)

The variable bIsEscapeSample is derived as follows:If PaletteIndexMap[xCb+xL][yCb+yL] is equal to MaxPaletteIndex andpalette_escape_val_present_flag is equal to 1, bIsEscapeSample is setequal to 1.Otherwise, bIsEscapeSample is set equal to 0.If bIsEscapeSample is equal to 0, the following applies:

recSamples[x][y]=CurrentPaletteEntries[cIdx][PaletteIndexMap[xCb+xL][yCb+yL]]  (8-71)

Otherwise, if cu_transquant_bypass_flag is equal to 1, the followingapplies:

recSamples[x][y]=PaletteEscapeVal[cIdx[]xCb+xL ][yCb+yL]  (8-72)

Otherwise (bIsEscapeSample is equal to 1 and cu_transquant_bypass_flagis equal to 0), the following ordered steps apply:The derivation process for quantization parameters as specified inclause 8.7.1 is invoked with the location (xCb,yCb) specifying thetop-left sample of the current block relative to the top-left sample ofthe current picture.The quantization parameter qPis derived as follows:If cIdx is equal to 0,

qP=Max(,Qp′Y)   (8-73)

Otherwise, if cIdx is equal to 1,

qP=Max(,Qp′Cb)   (8-74)

Otherwise (cIdx is equal to 2),

qP=Max(,Qp′Cr)   (8-75)

The variables bitDepth is derived as follows:

bitDepth=(cIdx==0)?Hit Depth_(Y):BitDepth_(C)   (8-76)

[[The list levelScale[ ] is specified as levelScale[k]={40, 45, 51, 57,64, 72} with k=0 . . . 51]]The following applies:

[[tmpVal=(PaletteEscapeVal[cIdx][xCb+xL][yCb+yL]*levelScale[qP%6])<<(qP/6)+32)>>6  (8-77)

recSamples[x][y]=Clip3(0,(1<<bitDepth)−1,tmpVal)  (8-78)]]

recSamples[x][y]=Clip3(0,(1<<bitDepth)−1,PaletteEscapeVal[cIdx][xCb+xL][yCh+yL])   (8-78)

When one of the following conditions is true:cIdx is eipial to 0 and numComps is equal to 1;cIdx is equal to 3;the variable PredictorPaletteSize[startComp] and the arrayPredictorPaletteEntries are derived or modified as follows:

for(i=0;i<CurrentPaletteSize[startComp];i++)

for(cIdx=startComp;cIdx<(startComp+numComps);cIdx++)

newPredictorPaletteEntries[cIdx][i]=CurrentPaletteEntries[cIdx][i]

newPredictorPaletteSize=CurrentPaletteSize][startComp]

for(i=0;i<PredictorPaletteSize&&newPredictorPaletteSize<PaletteMaxPredictorSize;i++)

if(!PalettePredictorEntryReuseFlags[i]){for(cIdx=startComp;cIdx<(startComp+numComps);cIdx++)  (8-79)

newPredictorPaletteEntries[cIdx][newPredictorPaletteSize]=PredictorPaletteEntriesf cIdx][i]newPredictorPaletteSize++}

for(cIdx=startComp;cIdx<(startComp+numComps);cIdx++)

for(i=0;i<newPredictorPaletteSize;i++)

PredictorPaletteEntries[cIdx][i]=newPredictorPaletteEntries[cIdx][i]

PredictorPaletteSize[startComp][=newPredictorPaletteSize

It is a requirement of bitstream conformance that the value ofPredictorPaletteSize[startComp] shall be in the range of 0 toPaletteMaxPredictorSize, inclusive.

5.14 Embodiment #14 8.4.5.3 Decoding Process for Palette Mode

Inputs to this process are:

-   -   a location (xCb, yCb) specifying the top-left luma sample of the        current block relative to the top-left luma sample of the        current picture,    -   a variable startComp specifies the first colour component in the        palette table,    -   a variable cIdx specifying the colour component of the current        block,    -   two variables nCbW and nCbH specifying the width and height of        the current block, respectively.        Output of this process is an array recSamples[x][y], with x=0 .        . . nCbW−1, y=0 . . . nCbH−1 specifying reconstructed sample        values for the block.        Depending on the value of cIdx, the variables nSubWidth and        nSubHeight are derived as follows:    -   If cIdx is equal to 0, nSubWidth is set to 1 and nSubHeight is        set to 1.    -   Otherwise, nSubWidth is set to SubWidthC and nSubHeight is set        to SubHeightC.        The (nCbW×nCbH) block of the reconstructed sample array        recSamples at location (xCb, yCb) is represented by        recSamples[x][y] with x=0 . . . nCTbW−1 and y=0 . . . nCbH−1,        and the value of recSamples[x][y] for each x in the range of 0        to nCbW−1, inclusive, and each y in the range of 0 to nCbH−1,        inclusive, is derived as follows:    -   The variables xL and yL are derived as follows:

xL=palette_transpose_flag?x*nSubHeight:x*nSubWidth  (8-234)

yL=palette_transpose_flag?y*nSubWidth:y*nSubHeight  (8-235)

-   -   The variable bIsEscapeSample is derived as follows:        -   If PaletteIndexMap[xCb+xL][yCb+yL] is equal to            MaxPaletteIndex and palette_escape_val_present_flag is equal            to 1, bIsEscapeSample is set equal to 1.        -   Otherwise, bIsEscapeSample is set equal to 0.    -   If bIsEscapeSample is equal to 0, the following applies:

recSamples[x][y]=CurrentPaletteEntries[cIdx][PaletteIndexMap[xCb+xL][yCb+yL]]  (8-236)

-   -   Otherwise, if cu_transquant_bypass_flag is equal to 1, the        following applies:

recSamples[x][y]=PaletteEscapeVal[cIdx][xCb+xL][yCb+yL]  (8-237)

-   -   Otherwise (bIsEscapeSample is equal to 1 and        cu_transquant_bypass_flag is equal to 0), the following ordered        steps apply:        -   1. The derivation process for quantization parameters as            specified in clause 8.7.1 is invoked with the location (xCb,            yCb) specifying the top-left sample of the current block            relative to the top-left sample of the current picture.            -   [Ed. (BB): QPs are already derived at the beginning of                the intra CU decoding process so there is no need to                derive them again within this subclause. Although it is                like that in HEVC v4 SCC, I think this redundancy can be                removed. Please confirm.]        -   2. The quantization parameter qP is derived as follows:            -   If cIdx is equal to 0,

qP=Max(QpPrimeTsMin,Qp′Y)  (8-238)

-   -   -   -   Otherwise, if cIdx is equal to 1,

qP=MaxQpPrimeTsMin,Qp′Cb)   (8-239)

-   -   -   -   Otherwise (cIdx is equal to 2),

qP=Max(QpPrimeTsMin,Qp′Cr)   (8-240)

Where min_qp_prime_ts_minus4 specifies the minimum allowed quantizationparameter for transform skip mode as follows:

QpPrimeTsMin=4+min_qp_prime_ts_minus4

-   -   3. The variables bitDepth is derived as follows:

bitDepth=(cIdx==0)?BitDepthy:BitDepthc  (8-241)

-   -   4. The list levelScale[ ] is specified as levelScale[k]={40, 45,        51, 57, 64, 72} with k=0 . . . 5.        -   [Ed. (BB): For non-palette CUs, levelScale depends on            rectNonTsFlag, should that be applied here too?]    -   5. The following applies:

tmpVal=(PaletteEscapeVal[cIdx][xCb+xL][yCb yL]*levelScale[qP%6])<<(qP/6)+32)>>6  (8-242)

recSamples[x][y]=Clip3(0,(1<<bitDepth)−1,tmpVal)  (8-243)

When one of the following conditions is true:

-   -   cIdx is equal to 0 and numComps is equal to 1;    -   cIdx is equal to 3;        the variable PredictorPaletteSize[startComp] and the array        PredictorPaletteEntries are derived or modified as follows:

for( i = 0; i < CurrentPaletteSize[ startComp ]; i++ )  for( cIdx =startComp; cIdx < (startComp + numComps); cIdx++ )  newPredictorPaletteEntries[ cIdx ][ i ] = CurrentPaletteEntries[ cIdx][ i ] newPredictorPaletteSize = CurrentPaletteSize[ startComp ] for( i= 0; i < PredictorPaletteSize && newPredictorPaletteSize <PaletteMaxPredictorSize; i++ )  if( !PalettePredictorEntryReuseFlags[ i] ) {   for( cIdx = startComp; cIdx < (startComp + numComps); cIdx++)     (8-244)    newPredictorPaletteEntries[ cIdx ][newPredictorPaletteSize ] =     PredictorPaletteEntries[ cIdx ][ i ]  newPredictorPaletteSize++  } for( cIdx = startComp; cIdx < (startComp + numComps ); cIdx++ )  for( i = 0; i <newPredictorPaletteSize; i++ )   PredictorPaletteEntries[ cIdx ][ i ] =newPredictorPaletteEntries[ cIdx ][ i ] PredictorPaletteSize[ startComp] = newPredictorPaletteSizeIt is a requirement of bitstream conformance that the value ofPredictorPaletteSize[startComp] shall be in the range of 0 toPaletteMaxPredictorSize, inclusive.

5.15 Embodiment #15 8.4.2 Derivation Process for Luma Intra PredictionMode

-   -   Otherwise (skip_intra_flag[xPb][yPb] and DimFlag[xPb][yPb] are        both equal to 0), IntraPredModeY[xPb][yPb] is derived by the        following ordered steps:        -   1. The neighbouring locations (xNbA, yNbA) and (xNbB, yNbB)            are set equal to (xPb−1, yPb) and (xPb, yPb−1),            respectively.        -   2. For X being replaced by either A or B, the variables            candIntraPredModeX are derived as follows:            -   The availability derivation process for a block in                z-scan order as specified in clause 6.4.1 is invoked                with the location (xCurr, yCurr) set equal to (xPb, yPb)                and the neighbouring location (xNbY, yNbY) set equal to                (xNbX, yNbX) as inputs, and the output is assigned to                availableX.            -   The candidate intra prediction mode candIntraPredModeX                is derived as follows:                -   If availableX is equal to FALSE, candIntraPredModeX                    is set equal to INTRA_DC.                -   [[— Otherwise, if CuPredMode[xNbX][yNbX] is not                    equal to MODE_INTRA or pcm_flag[xNbX][yNbX] is equal                    to 1 or, candIntraPredModeX is set equal to                    INTRA_DC,]]                -   Otherwise, if CuPredMode[xNhX][yNbX] is not equal to                    MODE_INTRA, pcm_flag[xNbX][yNbX] is equal to 1 or                    palette_mode_flag is equal to 1, candIntraPredModeX                    is set equal to INTRA_DC,                -   Otherwise, if X is equal to B and yPb−1 is less than                    ((yPb>>CtbLog2SizeY)<<CtbLog2SizeY),                    candIntraPredModeB is set equal to INTRA_DC.                -   Otherwise, if IntraPredModeY[xNbX][yNbX] is greater                    than 34, candIntraPredModeX is set equal to                    INTRA_DC.

5.16 Embodiment #16 8.4.2 Derivation Process for Luma Intra PredictionMode

Input to this process are:

-   -   a luma location (xCb, yCb) specifying the top-left sample of the        current luma coding block relative to the top-left luma sample        of the current picture,    -   a variable cbWidth specifying the width of the current coding        block in luma samples,    -   a variable cbHeight specifying the height of the current coding        block in luma samples.        In this process, the luma intra prediction mode        IntraPredModeY[xCb][yCb] is derived.    -   1. For X being replaced by either A or B, the variables        candIntraPredModeX are derived as follows:        -   The availability derivation process for a block as specified            in clause 6.4.X (BB): Neighbouring blocks availability            checking process tbd] is invoked with the location (xCurr,            yCurr) set equal to (xCb, yCb) and the neighbouring location            (xNbY, yNbY) set equal to (xNbX, yNbX) as inputs, and the            output is assigned to availableX.        -   The candidate intra prediction mode candIntraPredModeX is            derived as follows:            -   If one or more of the following conditions are true,                candIntraPredModeX is set equal to INTRA_PLANAR.                -   The variable availableX is equal to FALSE.                -   CuPredMode[xNbX][yNbX] is not equal to MODE_INTRA.                -   pred_mode_plt_flag is equal to 1.                -   intra_mip_flag[xNbX][yNbX] is equal to 1.                -   X is equal to B and yCb−1 is less than                    ((yCb>>CtbLog2SizeY)<<CtbLog2SizeY).            -   Otherwise, candIntraPredModeX is set equal to                IntraPredModeY[xNbX][yNbX].                The variable IntraPredModeY[x][y] with x=xCb . . .                xCb+cbWidth−1 and y=yCb . . . yCb+cbHeight−1 is set to                be equal to IntraPredModeY[xCb][yCb].

5.17 Embodiment #17 8.4.3 Derivation Process for Luma Intra PredictionMode

Input to this process are:

-   -   a luma location (xCb, yCb) specifying the top-left sample of the        current luma coding block relative to the top-left luma sample        of the current picture,    -   a variable cbWidth specifying the width of the current coding        block in luma samples,    -   a variable cbHeight specifying the height of the current coding        block in luma samples.        In this process, the luma intra prediction mode        IntraPredModeY[xCb][yCb] is derived.    -   2. For X being replaced by either A or B, the variables        candIntraPredModeX are derived as follows:        -   The availability derivation process for a block as specified            in clause 6.4.X [Ed. (BB): Neighbouring blocks availability            checking process tbd] is invoked with the location (xCurr,            yCurr) set equal to (xCb, yCb) and the neighbouring location            (xNbY, yNbY) set equal to (xNbX, yNbX) as inputs, and the            output is assigned to availableX.        -   The candidate intra prediction mode candIntraPredModeX is            derived as follows:            -   If one or more of the following conditions are true,                candIntraPredModeX is set equal to [[INTRA_PLANAR]]                INTRA_DC                -   The variable availableX is equal to FALSE.                -   CuPredMode[xNbX][yNbX] is not equal to MODE_INTRA.                -   intra_mip_flag[xNbX][yNbX] is equal to 1.                -   X is equal to B and yCb−1 is less than                    ((yCb>>CtbLog2SizeY)<<CtbLog2SizeY).            -   Otherwise, candIntraPredModeX is set equal to                IntraPredModeY[xNbX][yNbX].                The variable IntraPredModeY[x][y] with x=xCb . . .                xCb+cbWidth−1 and y=yCb . . . yCb+cbHeight−1 is set to                be equal to IntraPredModeY[xCb][yCb].

5.18 Embodiment #18 8.4.3 Derivation Process for Luma Intra PredictionMode

Input to this process are:

-   -   a luma location (xCb, yCb) specifying the top-left sample of the        current luma coding block relative to the top-left luma sample        of the current picture,    -   a variable cbWidth specifying the width of the current coding        block in luma samples,    -   a variable cbHeight specifying the height of the current coding        block in luma samples.        In this process, the luma intra prediction mode        IntraPredModeY[xCb][yCb] is derived.    -   3. For X being replaced by either A or B, the variables        candIntraPredModeX are derived as follows:        -   The availability derivation process for a block as specified            in clause 6.4.X [Ed. (BB): Neighbouring blocks availability            checking process tbd] is invoked with the location (xCurr,            yCurr) set equal to (xCb, yCb) and the neighbouring location            (xNbY, yNbY) set equal to (xNbX, yNbX) as inputs, and the            output is assigned to availableX.        -   The candidate intra prediction mode candIntraPredModeX is            derived as follows:            -   If one or more of the following conditions are true,                candIntraPredModeX is set equal to [[INTRA_PLANAR]]                INTRA DC                -   The variable availableX is equal to FALSE.                -   CuPredMode[xNbX][yNbX] is not equal to MODE_INTRA.                -   intra_mip_flag[xNbX][yNbX] is equal to 1.                -   pred_mode_plt_flag is equal to 1.                -   X is equal to B and yCb−1 is less than                    ((yCb>>CtbLog2SizeY)<<CtbLog2SizeY).            -   Otherwise, candIntraPredModeX is set equal to                IntraPredModeY[xNbX][yNbX].                The variable IntraPredModeY[x][y] with x=xCb . . .                xCb+cbWidth−1 and y=yCb . . . yCb+cbHeight−1 is set to                be equal to IntraPredModeY[xCb][yCb].

5.19 Embodiment #19

Descriptor Coding_unit( x0, y0, cbWidth, cbHeight,treeTypeCurr,    isInSCIPURegion, SCIPUConsMode ) {   if( slice_type !=I || sps_ibc_enabled_flag || sps_plt_enabled_flag ) {   if(   treeTypeCurr   !=   DUAL_TREE_CHROMA   &&      !( ( (cbWidth == 4 && cbHeight = = 4) || SCIPUConsMode == MODE_NON_INTER) &&!sps_ibc_enabled_flag ) )      cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0  &&  slice_type  !=  I      && !(cbWidth = = 4 && cbHeight = = 4 ) && SCIPUConsMode == MODE_ALL)     pred mode flag ae(v)    if( ( ( slice_type = = I &&  cu_skip_flag[x0 ][ y0 ] = =0 ) | |      ( slice_type != I && ( CuPredMode[ x0 ][ y0 ]!= MODE_INTRA ||      ( cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[x0 ][ y0 ] = =    0    )     )     )     )     &&     sps_ibc_enabled_flag && ( cbWidth != 128 || cbHeight != 128 ) &&SCIPUConsMode != MODE_INTER)      pred_mode_ibc_flag ae(v)  if(CuPredMode[ x0 ][ y0 ] == MODE_INTRA || (slice_type != I && !(cbWidth == 4   && cbHeight = = 4 ) && !sps_ibc_enabled_flag && CuPredMode[ x0 ][y0 ] !=   MODE_INTRA )) && cbWidth <= 64 && cbHeight <= 64 &&sps_plt_enabled_flag   && cu_skip_flag[ x0 ][ y0 ] = = 0 &&SCIPUConsMode!= MODE_INTER)       pred_mode_plt_flag ae(v)    } if(isInSCIPURegion  &&  SCIPUConsMode  ==  MODE_ALL && CuPredMode[ x0][ y0 ] != MODE_INTER){   treeType = DUAL_TREE_LUMA  } else {   treeType= treeTypeCurr  } ... }

5.20 Embodiment #20

Descriptor Coding_unit( x0, y0, cbWidth, cbHeight,treeTypeCurr,    isInSCIPURegion, SCIPUConsMode ) {   if( slice_type !=I || sps_ibc_enabled_flag || sps_plt_enabled_flag ) {   if(   treeTypeCur   !=   DUAL_TREE_CHROMA   &&     !( ( (cbWidth = =4 && cbHeight = = 4) || SCIPUConsMode == MODE_NON_INTER) &&!sps_ibc_enabled_flag ) )     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0  &&  slice_type  !=  I     && !(cbWidth = = 4 && cbHeight = = 4 ) && SCIPUConsMode == MODE_ALL)    pred_mode_flag ae(v)    if( ( ( slice_type = = I && cu_skip_flag[ x0][ y0 ] = =0 ) ||     ( slice_type != I && ( CuPredMode[ x0 ][ y0 ] !=MODE_INTRA ||     ( cbWidth = = 4 && cbHeight = = 4 &&  cu_skip_flag[ x0][ y0 ] = =    0    )     )     )     )     &&     sps_ibc_enabled_flag&& ( cbWidth != 128 || cbHeight != 128 ) && SCIPUConsMode != MODE_INTER)    pred_mode_ibc_flag ae(v)  if( CuPredMode[ x0 ][ y0 ] == MODE_INTRA&& cbWidth <= 64 && cbHeight <= 64  && sps_plt_enabled_flag &&cu_skip_flag[ x0 ][ y0 ] = = 0 && SCIPUConsMode!=  MODE_INTER)     pred_mode_plt_flag ae(v)   } if(isInSCIPURegion && SCIPUConsMode == MODE_ALL && CuPredMode[ x0 ][ y0] != MODE_INTER){   treeType = DUAL_TREE_LUMA  } else {   treeType =treeTypeCurr  } ... }

5.21 Embodiment #21

Descriptor Coding_unit( x0, y0, cbWidth, cbHeight,treeTypeCurr,     isInSCIPURegion, SCIPUConsMode ) {   if( slice_type !=I || sps_ibc_enabled_flag || sps_plt_enabled_flag ) {   if(   treeTypeCurr   !=   DUAL_TREE_CHROMA   &&     !( ( (cbWidth = =4 && cbHeight = = 4) || SCIPUConsMode == MODE_NON_INTER) &&!sps_ibc_enabled_flag ) )     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] == 0  &&  slice_type  !=  I     && !(cbWidth = = 4 && cbHeight = = 4 ) && SCIPUConsMode == MODE_ALL)    pred_mode_flag ae(v)    if( ( ( slice_type = = I  &&  cu_skip_flag[x0 ][ y0 ] = =0 ) ||     ( slice_type != I  &&   (  CuPredMode[ x0 ][ y0]  != MODE_INTRA                           ||     ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] ==     0     )     )     )     )     &&     sps_ibc_enabled_flag && (cbWidth != 128 || cbHeight != 128 ) && SCIPUConsMode != MODE_INTER)    pred_mode_ibc_flag ae(v)  if( ( ( ( slice_type = = I || (cbWidth = =4 && cbHeight = = 4) || sps_ibc_enabled_flag ) && CuPredMode[ x0 ][ y0 ]== MODE_INTRA ) || (slice type != I && !(cbWidth = = 4   && cbHeight = =4 ) && !sps_ibc_enabled_flag && CuPredMode[ x0 ][ y0 ] !=   MODE INTRA )) && cbWidth <= 64 && cbHeight <= 64 && sps_plt   _enabled_flag &&cu_skip_flag[ x0 ][ y0 ] = = 0 &&  SCIPUConsMode != MODE_INTER)     pred_mode_plt_flag ae(v)    } if(isInSCIPURegion && SCIPUConsMode  ==  MODE_ALL  && CuPredMode[ x0 ][y0 ] != MODE_INTER){   treeType = DUAL_TREE_LUMA  } else {   treeType =treeTypeCurr  } ... }

5.22 Embodiment #22

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag is signalled after the pred_mode_ibc_flag.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I || sps_ibc_enabled_flag || sps_plt_enabled_flag) {    if(  treeType  !=  DUAL_TREE_CHROMA   &&     !( [[cbWidth  ==  4  &&  cbHeight = = 4 && !sps_ibc_enabled_flag ) ]]  ( ( cbWidth = =4 && cbHeight = = 4 ) || modeType = = MODE_TYPE_INTRA )     &&!sps_ibc_enabled_flag ))     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0  &&  slice_type  !=  I     && !(cbWidth = = 4 && cbHeight = = 4 ) && modeType = = MODE_TYPE_ALL)    pred_mode_flag ae(v) [[  if( ( ( slice_type = = I  &&  cu_skip_flag[x0 ][ y0 ] = =0 )  ||     ( slice_type != I && ( CuPredMode[ x0 ][ y0 ]!= MODE_INTRA ||     ( cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[x0 ][ y0 ] = =     0     )    )    )    )    &&     sps_ibc_enabled_flag&& ( cbWidth != 128 || cbHeight != 128 ) )||    if( ( ( slice_type = =I && cu_skip_flag[ x0 ][ y0 ] = =0 ) ||     ( slice_type != I && (CuPredMode[ x0 ][ y0 ] != MODE_INTRA ||     ( cbWidth = = 4 && cbHeight= = 4 && cu_skip_flag[ x0 ][ y0 ] = =     0     )    )    )    )    &&    cbWidth <= 64 && cbHeight <= 64 ) &&     modeType != MODE_TYPE_INTER) {     if(  sps_ibc_enabled_flag   &&   treeType   != DUAL_TREE_CHROMA)      pred_mode_ibc_flag ae(v)  }  if( ( ( ( slice_type = = I ||(cbWidth = = 4 && cbHeight = = 4 ) || sps_ibc_enabled_flag ) &&CuPredMode[ x0 ][ y0 ] == MODE_INTRA ) || (slice_type != I && !(cbWidth= = 4   && cbHeight = = 4 ) && !sps_ibc_enabled_flag && CuPredMode[ x0][ y0 ] !=   MODE_INTRA ) ) && cbWidth <= 64 && cbHeight <= 64 &&sps_plt   _enabled_flag && cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType !=MODE_INTER)       pred_mode_plt_flag ae(v)  } ... }

5.23 Embodiment #23

Descriptor Coding_unit( x0, y0, cbWidth, cbHeight, treeTypeCurr,isInSCIPURegion, SCIPUConsMode ) {   if( slice_type != I ||sps_ibc_enabled_flag || sps_plt_enabled_flag ) {   if(  treeTypeCurr   !=   DUAL_TREE_CHROMA    &&     !( ( (cbWidth = =4 && cbHeight = = 4) || SCIPUConsMode == MODE_NON_INTER) &&!sps_ibc_enabled_flag ) )     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0  &&  slice_type  !=  I     && !(cbWidth = = 4 && cbHeight = = 4 ) && = SCIPUConsMode == MODE_ALL)    pred_mode_flag ae(v)    if( ( ( slice_type = = I  &&  cu_skip_flag[x0 ][ y0 ] = =0 )  ||     ( slice_type != I && ( CuPredMode[ x0 ][ y0 ]!= MODE_INTRA ||     ( cbWidth = = 4 && cbHeight = = 4 && cu_skip_flag[x0 ][ y0 ] = =     0      )     )     )    )    &&    sps_ibc_enabled_flag && ( cbWidth !=128 || cbHeight != 128 ) &&SCIPUConsMode != MODE_INTER)      pred_mode_ibc_flag ae(v)  if( ( ( (slice_type = = I || (cbWidth = = 4 && cbHeight = = 4 ) ||pred_mode_ibc_flag && CuPredMode[ x0 ][ y0 ] == MODE_INTRA ) ||(slice_type != I && !(cbWidth = = 4   && cbHeight = = 4 ) &&!pred_mode_ibc_flag && CuPredMode[ x0 ][ y0 ] !=   MODE_INTRA ) ) &&cbWidth <= 64 && cbHeight <= 64 && sps_plt_enabled_flag && cu_skip_flag[x0 ][ y0 ] = = 0 && SCIPUConsMode != MODE_INTER)      pred_mode_plt_flag ae(v)    }  if(isInSCIPURegion && SCIPUConsMode== MODE_ALL && CuPredMode[ x0 ][ y0 ] != MODE_INTER){   treeType =DUAL_TREE_LUMA  } else {   treeType = treeTypeCurr  } ... }

5.24 Embodiment #24

This embodiment describes the coding unit syntax. In this embodiment,the pred_mode_plt_flag is signalled after the pred_mode_ibc_flag.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, treeType, modeType ){   if( slice_type != I || sps_ibc_enabled_flag || sps_plt_enabled_flag) {    if(  treeType  !=  DUAL_TREE_CHROMA  &&     !(  [[cbWidth == 4  &&  cbHeight = = 4 && !sps_ibc_enabled_flag ) ]]  ( ( cbWidth = = 4&& cbHeight = = 4 ) || modeType = = MODE_TYPE_INTRA )     &&!sps_ibc_enabled_flag ))     cu_skip_flag[ x0 ][ y0 ] ae(v)   if( cu_skip_flag[ x0 ][ y0 ] = = 0 && slice_type != I     && !(cbWidth = = 4 && cbHeight = = 4 ) && modeType = = MODE_TYPE_ALL)    pred_mode_flag ae(v) [[  if( ( ( slice_type = = I && cu_skip_flag[x0 ][ y0 ] = =0 ) ||     ( slice_type != I && ( CuPredMode[ x0 ][ y0 ]!= MODE_INTRA                       ||     ( cbWidth = = 4 && cbHeight == 4 && cu_skip_flag[ x0 ][ y0 ] = =     0    )    )    )    )    &&    sps_ibc_enabled_flag && ( cbWidth != 128 || cbHeight != 128 ) )]]   if( ( ( slice_type = = I && cu_skip_flag[ x0 ][ y0 ] = =0 ) ||     (slice_type != I && ( CuPredMode[ x0 ][ y0 ] !=MODE_INTRA                       ||     ( cbWidth = = 4 && cbHeight = =4 && cu_skip_flag[ x0 ][ y0 ] = =     0    )    )    )    )    &&    cbWidth <=64 && cbHeight <= 64 ) &&    modeType != MODE_TYPE_INTER ){     if(  sps_ibc_enabled_flag  &&  treeType   ! = DUAL_TREE_CHROMA )    pred_mode_ibc_flag ae(v)  }  if( ( ( ( slice_type = = I || (cbWidth= = 4 && cbHeight = = 4 ) || pred_mode_ibc_flag) && CuPredMode[ x0 ][ y0] == MODE_INTRA) || (slice_type != I && !(cbWidth = = 4   && cbHeight == 4 ) && ! pred_mode_ibc_flag && CuPredMode[ x0 ][ y0 ] !=   MODE_INTRA) ) && cbWidth <= 64 && cbHeight <= 64 && sps_plt   _enabled_flag &&cu_skip_flag[ x0 ][ y0 ] = = 0 && modeType != MODE_INTER)     pred_mode_plt_flag ae(v)  } ... }

5.25 Embodiment #25

This embodiment describes the coding unit syntax. In this embodiment,the palette syntax is signalled if the current prediction mode isMODE_PLT.

7.3.7.5 Coding Unit Syntax

Descriptor coding_unit( x0, y0, cbWidth, cbHeight, cqtDepth, treeType,modeType ) {   chType = treeType = = DUAL_TREE_CHROMA? 1 : 0   if(slice_type != I || sps_ibc_enabled_flag || sps_palette_enabled_flag) {   if(    treeType    !=    DUAL_TREE_CHROMA   &&     !( ( ( cbWidth = =4 && cbHeight = = 4 ) || modeType = =MODE_TYPE_INTRA                     )      && !sps_ibc_enabled_flag ) )    cu_skip_flag[ x0 ][y0 ] ae(v)    if( cu_skip_flag[ x0 ][ y0 ]  ==  0  &&  slice_type  !=  I     && !( cbWidth = = 4 && cbHeight = = 4) && modeType = = MODE_TYPE_ALL )     pred_mode_flag ae(v)    if( ( (slice_type == I  && cu_skip_flag[ x0 ][ y0 ] = =0 )   ||       (slice_type != I && ( CuPredMode[ chType ][ x0 ][ y0 ] !=MODE_INTRA                           ||        ( cbWidth = = 4 &&cbHeight = = 4 && cu_skip_flag[ x0 ][ y0 ] = = 0 ) ) ) )                              &&      cbWidth <= 64 && cbHeight <= 64 && modeType !=MODE_TYPE_INTER                        &&       sps_ibc_enabled_flag &&treeType != DUAL_TREE_CHROMA )       pred_mode_ibc_flag ae(v)    if( ( (( slice_type = = I || ( cbWidth = = 4 && cbHeight = = 4 ) ||sps_ibc_enabled_flag            )             &&       CuPredMode[ x0 ][y0 ]    = =    MODE_INTRA )  ||     ( slice_type != I && !( cbWidth = =4 && cbHeight = = 4 ) && !sps_ibc_enabled_flag     &&   CuPredMode[ x0][ y0 ] != MODE_INTRA ) )   &&sps_palette_enabled_flag                       &&    cbWidth <=64 && cbHeight <= 64 && && cu_skip_flag[ x0 ][ y0 ] ==                0               &&    modeType != MODE_INTER )   pred_mode_plt_flag ae(v)   }  }  if([[CuPredMode[ chType ][ x0 ][ y0]   = =   MODE_INTRA  ||]]   CuPredMode[ chType ][ x0 ][ y0 ] = =MODE_PLT ) {   if( treeType = = SINGLE_TREE || treeType = =DUAL_TREE_LUMA ) {    if( pred_mode_plt_flag ) {     if( treeType = =DUAL_TREE_LUMA )       palette_coding( x0, y0, cbWidth, cbHeight, 0, 1 )     else /* SINGLE_TREE */       palette_coding( x0, y0, cbWidth,cbHeight, 0, 3 )    } else {  ...   } ...  }

5.26 Embodiment #26

This embodiment describes the derivation process of chroma intraprediction mode.

Derivation Process for Chroma Intra Prediction Mode

Input to this process are:

-   -   a luma location (xCb, yCb) specifying the top-left sample of the        current chroma coding block relative to the top-left luma sample        of the current picture,    -   a variable cbWidth specifying the width of the current coding        block in luma samples,    -   a variable cbHeight specifying the height of the current coding        block in luma samples.        In this process, the chroma intra prediction mode        IntraPredModeC[xCb][yCb] is derived.        The corresponding luma intra prediction mode lumalntraPredMode        is derived as follows:    -   If intramip_flag[xCb][yCb] is equal to 1, lumalntraPredMode is        set equal to INTRA_PLANAR.    -   Otherwise, if CuPredMode[0][xCb][yCb] is equal to MODE_IBC or        MODE_PLT, lumalntraPredMode is set equal to INTRA_DC.    -   Otherwise, lumalntraPredMode is set equal to        IntraPredModeY[xCb+cbWidth/2][yCb+cbHeight/2].

5.27 Embodiment #27

This embodiment describes the picture reconstruction process withmapping process for luma samples.

Picture reconstruction with mapping process for luma samples. Inputs tothis process are:

-   -   a location (xCurr, yCurr) of the top-left sample of the current        block relative to the top-left sample of the current picture,    -   a variable nCurrSw specifying the block width,    -   a variable nCurrSh specifying the block height,    -   an (nCurrSw)×(nCurrSh) array predSamples specifying the luma        predicted samples of the current block,    -   an (nCurrSw)×(nCurrSh) array recSamples specifying the luma        residual samples of the current block.        Outputs of this process is a reconstructed luma picture sample        array recSamples.        The (nCurrSw)×(nCurrSh) array of mapped predicted luma samples        predMapSamples is derived as follows:    -   If one of the following conditions is true, predMapSamples[i][j]        is set equal to predSamples[i][j] for i=0 . . . nCurrSw−1, j=0 .        . . nCurrSh−1:        -   CuPredMode[0][xCurr][yCurr] is equal to MODE_INTRA.        -   CuPredMode[0][xCurr][yCurr] is equal to MODE_IBC.        -   CuPredMode[0][xCurr][yCurr] is equal to MODE_PLT.        -   CuPredMode[0][xCurr][yCurr] is equal to MODE_INTER and            ciip_flag[xCurr][yCurr] is equal to 1.

Otherwise (CuPredMode[0][xCurr][yCurr] is equal to MODE_INTER andciip_flag[xCurr][yCurr] is equal to 0), the following applies:

5.28 Embodiment #28

This embodiment describes example scanning orders correponding to thebullet 24 in Section 4.

Input to this process is a block width blkWidth and a block heightblkHeight.Output of this process are the arrays hReverScan[sPos][sComp] andvReverScan[sPos][sComp]. The array hReverScan represents the horizontalreverse scan order and the array vReverScan represents the verticaltraverse scan order. The array index sPos specifies the scan positionranging from 0 to (blkWidth*blkHeight)−1, inclusive. The array indexsComp equal to 0 specifies the horizontal component and the array indexsComp equal to 1 specifies the vertical component. Depending on thevalue of blkWidth and blkHeight, the array hTravScan and vTravScan arederived as follows:

  i = 0 for(y = 0; y < blkHeight; y++ ) {  if( y % 2 != 0 ){   for( x =0; x < blkWidth; x++ ) {    hReverScan[ i ][ 0 ] = x    hReverScan [ i][ 1 ] = y    i++   } } else {  for( x = blkWidth − 1; x >= 0; x− − ) {   hReverScan [ i ][ 0 ] = x    hReverScan [ i ][ 1 ] = y    i++  } } }i = 0 for( x = 0; x < blkWidth; x++ ) {  if( x % 2 != 0)  {   for( y =0; y < blkHeight; y++ ) {    vReverScan[ i ][ 0 ] = x    vReverScan [ i][ 1 ] = y    i++   }  }  else  {   for( y = blkHeight − 1; y >= 0; y− −) {    vReverScan [ i ][ 0 ] = x    vReverScan [ i ][ 1 ] = y    i++   } } }

FIG. 6 is a block diagram of a video processing apparatus 600. Theapparatus 600 may be used to implement one or more of the methodsdescribed herein. The apparatus 600 may be embodied in a smartphone,tablet, computer, Internet of Things (IoT) receiver, and so on. Theapparatus 600 may include one or more processors 602, one or morememories 604 and video processing hardware 606. The processor(s) 602 maybe configured to implement one or more methods described in the presentdisclosure. The memory (memories) 604 may be used for storing data andcode used for implementing the methods and embodiments described herein.The video processing hardware 606 may be used to implement, in hardwarecircuitry, some embodiments described in the present disclosure. In someembodiments, the hardware 606 may be at least partly internal to theprocessors 602 (e.g., a graphics co-processor).

FIG. 8 is a flowchart for a method 800 of processing a video. The method800 includes determining (805) that palette mode is to be used forprocessing a transform unit, a coding block, or a region, usage ofpalette mode being coded separately from a prediction mode, andperforming (810) further processing of the transform unit, the codingblock, or the region using the palette mode.

With reference to method 800, some examples of palette mode coding andits use are described in Section 4 of the present disclosure.

With reference to method 800, a video block may be encoded in the videobitstream in which bit efficiency may be achieved by using a bitstreamgeneration rule related to palette mode coding.

The methods can include wherein the prediction mode is coded beforeindication of the usage of the palette mode.

The methods can include wherein the usage of palette mode isconditionally signalled based on the prediction mode.

The methods can include wherein the prediction mode is intra block copymode, and signalling of the indication of the usage of palette mode isskipped.

The methods can include wherein the indication of the usage of palettemode is determined to be false based on a current prediction mode beingintra block copy mode.

The methods can include wherein the prediction mode is inter mode, andsignalling of the indication of the usage of palette mode is skipped.

The methods can include wherein the indication of the usage of palettemode is determined to be false based on a current prediction mode beinginter mode.

The methods can include wherein the prediction mode is intra mode, andsignalling of the indication of the usage of palette mode is skipped.

The methods can include wherein the indication of the usage of palettemode is determined to be false based on a current prediction mode beingintra mode.

The methods can include wherein the prediction mode is intra mode, andsignalling of the indication of the usage of palette mode is skipped.

The methods can include wherein the prediction mode is intra block copymode, and signalling of the indication of the usage of palette mode isperformed.

The methods can include wherein the indication of the usage of palettemode is signalled based on a picture, a slice, or a tile group type.

The methods can include wherein the palette mode is added as a candidatefor the prediction mode.

The methods can include wherein the prediction mode includes one or moreof: intra mode, intra block copy mode, or palette modes for intraslices, inter slices, I pictures, P pictures, B pictures, or intra tilegroups.

The methods can include wherein the prediction mode includes two or moreof: intra mode, inter mode, intra block copy mode, or palette mode.

The methods can include wherein the usage of palette mode is indicatedvia signalling or derived based on a condition.

The methods can include wherein the condition includes one or more of: ablock dimension of a current block, a prediction mode of the currentblock, a quantization parameter (QP) of the current block, a paletteflag of neighboring blocks, an intra block copy flag of neighboringblocks, an indication of a color format, a separate or a dual codingtree structure, or a slice type or a group type or a picture type.

The methods can include wherein the usage of palette mode is signalledor derived based on a slice level flag, a tile group level flag, or apicture level flag.

The methods can include wherein indication of usage of intra block copymode is signalled or derived based on a slice level flag, a tile grouplevel flag, or a picture level flag.

With reference to items 6 to 9 disclosed in the previous section, someembodiments may preferably use the following solutions.

One solution may include a method of video processing, comprisingperforming a conversion between a current video block of a picture of avideo and a bitstream representation of the video in which informationabout whether or not an intra block copy mode is used in the conversionis signalled in the bitstream representation or derived based on acoding condition of the current video block, where the intra block copymode comprises coding the current video block from another video blockin the picture. The following features may be implemented in variousembodiments

-   -   wherein the coding condition includes block dimensions of the        current video block.    -   wherein the coding condition includes a prediction mode of the        current video block or a quantization parameter used in the        conversion for the current video block.

With reference to items 13-15 disclosed in the previous section, someembodiments may preferably implement the following solutions.

A solution may include a method for determining whether or not adeblocking filter is to be applied during a conversion of a currentvideo block of a picture of video, wherein the current video block iscoded using a palette mode coding in which the current video block isrepresented using representative sample values that are fewer than totalpixels of the current video block; and performing the conversion suchthat the deblocking filter is applied in case the determining is thatthe deblocking filter is to be applied.

Another solution may include a method of video processing, comprisingdetermining a quantization or an inverse quantization process for useduring a conversion between a current video block of a picture of avideo and a bitstream representation of the video, wherein the currentvideo block is coded using a palette mode coding in which the currentvideo block is represented using representative sample values that arefewer than total pixels of the current video block; and performing theconversion based on the determining the quantization or the inversequantization process. Additional features may include:

-   -   wherein the quantization or the inverse quantization process        determined for the current video block is different from another        quantization or another inverse quantization process applied to        another video block that is coded differently from the palette        coding mode.    -   wherein the conversion includes encoding the current video block        into the bitstream representation.    -   wherein the conversion includes decoding the bitstream        representation to generate the current video block of the video.    -   wherein the determining uses a decision process that is        identical to another decision process used for conversion of        another video block that is intra coded.

It will be appreciated that the disclosed embodiments may be embodied invideo encoders or decoders to improve compression efficiency usingenhanced coding tree structures.

With reference to items 16 to 21 in the previous section, some solutionsmay be as follows:

A method of video processing, comprising: determining, for a conversionbetween a current video block of a video comprising multiple videoblocks and a bitstream representation of the video, that the currentvideo block is a palette-coded block; based on the determining,performing a list construction process of most probable mode byconsidering the current video block to be an intra coded block; andperforming the conversion based on a result of the list constructionprocess, wherein the palette-coded block is coded or decoded using apalette or representation sample values.

The above method, wherein the list construction process treats aneighboring palette-coded block as an intra block with a default mode.

A method of video processing, comprising: determining, for a conversionbetween a current video block of a video comprising multiple videoblocks and a bitstream representation of the video, that the currentvideo block is a palette-coded block; based on the determining,performing a list construction process of most probable mode byconsidering the current video block to be a non-intra coded block; andperforming the conversion based on a result of the list constructionprocess, wherein the palette-coded block is coded or decoded using apalette or representation sample values.

The above method, wherein the list construction process treats aneighboring palette-coded block as an inter-coded block when fetching anintra mode of the neighboring palette coded block.

A method of video processing, comprising: determining, for a conversionbetween a current video block of a video comprising multiple videoblocks and a bitstream representation of the video, that the currentvideo block is a palette-coded block; based on the determining,performing a list construction process by considering the current videoblock to be an unavailable block; and performing the conversion based ona result of the list construction process, wherein the palette-codedblock is coded or decoded using a palette or representation samplevalues.

The above method, wherein the list construction process is for a historybased motion vector prediction.

The above method, wherein the list construction process is for a MERGEor an advanced motion vector prediction mode.

The above methods, wherein the determining further includes determiningbased on content of the video.

The above methods, wherein the determining corresponds to a filed in thebitstream representation.

A method of video processing, comprising: determining, during aconversion between a current video block and a bitstream representationof the current video block, that the current video block is a palettecoded block; determining, based on the current video block being thepalette coded block, a range of context coded bins used for theconversion; and performing the conversion based on the range of contextcoded bins.

The above method, wherein bins of the current video block that falloutside the range are coded using bypass coding technique or decodedusing a bypass decoding technique during the conversion.

The above methods, wherein the conversion comprises encoding the videointo the bitstream representation.

The above methods, wherein the conversion comprises decoding thebitstream representation to generate the video.

FIG. 24 is a block diagram showing an example video processing system2400 in which various embodiments disclosed herein may be implemented.Various embodiments may include some or all of the components of thesystem 2400. The system 2400 may include input 2402 for receiving videocontent. The video content may be received in a raw or uncompressedformat, e.g., 8- or 10-bit multi-component pixel values, or may be in acompressed or encoded format. The input 1902 may represent a networkinterface, a peripheral bus interface, or a storage interface. Examplesof network interface include wired interfaces such as Ethernet, passiveoptical network (PON), etc. and wireless interfaces such as Wi-Fi orcellular interfaces.

The system 2400 may include a coding component 2404 that may implementthe various coding or encoding methods described in the presentdisclosure. The coding component 2404 may reduce the average bitrate ofvideo from the input 2402 to the output of the coding component 2404 toproduce a coded representation of the video. The coding techniques aretherefore sometimes called video compression or video transcodingtechniques. The output of the coding component 2404 may be eitherstored, or transmitted via a communication connected, as represented bythe component 2406. The stored or communicated bitstream (or coded)representation of the video received at the input 2402 may be used bythe component 2408 for generating pixel values or displayable video thatis sent to a display interface 2410. The process of generatinguser-viewable video from the bitstream representation is sometimescalled video decompression. Furthermore, while certain video processingoperations are referred to as “coding” operations or tools, it will beappreciated that the coding tools or operations are used at an encoderand corresponding decoding tools or operations that reverse the resultsof the coding will be performed by a decoder.

Examples of a peripheral bus interface or a display interface mayinclude universal serial bus (USB) or high definition multimediainterface (HDMI) or DisplayPort, and so on. Examples of storageinterfaces include serial advanced technology attachment (SATA),peripheral component interface (PCI), integrated drive electronics (IDE)interface, and the like. The embodiments described in the presentdisclosure may be embodied in various electronic devices such as mobilephones, laptops, smartphones or other devices that are capable ofperforming digital data processing and/or video display.

FIG. 25 is a flowchart representation of a method 2500 for videoprocessing in accordance with the present embodiments. The method 2500includes, at operation 2510, performing a conversion between a block ofa video region of a video and a bitstream representation of the video.The bitstream representation is processed according to a first formatrule that specifies whether a first indication of usage of a palettemode is signalled for the block and a second format rule that specifiesa position of the first indication relative to a second indication ofusage of a prediction mode for the block.

In some embodiments, the video region comprises a transform unit, acoding unit, a prediction unit, or a region of the video. In someembodiments, the second indication of usage of the prediction mode ispositioned prior to the first indication of usage of the palette mode inthe bitstream representation.

In some embodiments, the first indication of usage of the palette modeis conditionally included in the bitstream representation based on thesecond indication of usage of the prediction mode. In some embodiments,the first indication of usage of the palette mode is skipped in thebitstream representation in case the second indication of usage of theprediction mode indicates an intra block copy (IBC) prediction mode. Insome embodiments, the first indication of usage of the palette mode isskipped in the bitstream representation in case the second indication ofusage of the prediction mode indicates an inter prediction mode. In someembodiments, the first indication of usage of the palette mode isskipped in the bitstream representation in case the second indication ofusage of prediction mode indicates an intra prediction mode. In someembodiments, the first indication of usage of the palette mode isskipped in the bitstream representation in case the second indication ofusage of prediction mode indicates a skip mode. In some embodiments,skipping the first indication of usage of the palette mode in thebitstream representation indicates that the palette mode is not used.

In some embodiments, the first indication of usage of the palette modeis coded in the bitstream in case the second indication of usage ofprediction mode indicates an IBC prediction mode. In some embodiments,the first indication of usage of the palette mode is coded in thebitstream in case the second indication of usage of prediction modeindicates an intra prediction mode. In some embodiments, the predictionmode is not a pulse-code modulation (PCM) mode. In some embodiments, thefirst indication of usage of the palette mode is coded prior to anindication of usage of a PCM mode in the bitstream representation. Insome embodiments, an indication of usage of a PCM mode is skipped in thebitstream representation. In some embodiments, an indication of the IBCmode is coded in the bitstream representation. In some embodiments, incase an intra prediction mode is used, a flag in the bitstreamrepresentations indicates whether the palette mode or the IBC mode issignalled in the bitstream representation. In some embodiments, the flagis skipped based on a condition of the block, the condition comprising adimension of the block, whether the IBC mode is enabled for a regionassociated with the block, or whether the palette mode is enabled forthe region associated with the block.

In some embodiments, the first indication of usage of the palette modeis coded in the bitstream in case the second indication of usage ofprediction mode indicates an inter prediction mode. In some embodiments,the first indication of usage of the palette mode is coded after atleast one of: an indication of a skip mode, the prediction mode, or anindication of usage of a PCM mode. In some embodiments, the firstindication of usage of the palette mode is coded after an indication ofa skip mode or the prediction mode and is coded before an indication ofusage of a PCM mode.

In some embodiments, the first indication of usage of the palette modeis positioned prior to the second indication of usage of the predictionmode in the bitstream representation. In some embodiments, the firstindication of usage of the palette mode is positioned after the secondindication of usage of the prediction mode, the second indication ofusage of the prediction mode indicating an intra or an inter predictionmode in the bitstream representation. In some embodiments, the firstindication of usage of the palette mode is signalled based on a picture,a slice, or a tile group type. In some embodiments, the first indicationof usage of the palette mode comprises a first flag indicating that thepalette mode is enabled for the block. In some embodiments, the firstindication of usage of the palette mode is conditionally included in thebitstream representation based on a first flag indicating that thepalette mode is enabled in a sequence level, a picture level, a tilegroup level, or a tile level. In some embodiments, another flagindicating a PCM mode of the block is included in the bitstreamrepresentation in case the palette mode is disabled for the block. Insome embodiments, the first flag is context coded based on informationof one or more neighboring blocks of the current block. In someembodiments, the first flag is coded without context information fromone or more neighboring blocks of the current block.

In some embodiments, the second indication of usage of a prediction modecomprises a second flag indicating the prediction mode. In someembodiments, in case the second flag in the bitstream representationindicates that the prediction mode is an inter mode, the bitstreamrepresentation further comprising a third flag indicating whether anintra block copy mode is enabled. In some embodiments, in case thesecond flag in the bitstream representation indicates that theprediction mode is an intra mode, the bitstream representation furthercomprising a third flag indicating whether an intra block copy mode isenabled. In some embodiments, the third flag is conditionally includedin the bitstream representation based on a dimension of the block.

In some embodiments, the block is a coding unit, and the second flag inthe bitstream representation indicates that the prediction mode is anintra mode. In some embodiments, the first flag is conditionallyincluded in the bitstream representation based on a dimension of theblock.

FIG. 26 is a flowchart representation of a method 2600 for videoprocessing in accordance with the present embodiments. The method 2600includes, at operation 2610, determining, for a conversion between ablock of a video region in a video and a bitstream representation of thevideo, a prediction mode based on one or more allowed prediction modesthat include at least a palette mode of the block. An indication ofusage of the palette mode is determined according to the predictionmode. The method 2600 includes, at operation 2620, performing theconversion based on the determining.

In some embodiments, the one or more allowed prediction modes comprisean intra mode. In some embodiments, the one or more allowed predictionmodes comprise an intra block copy (IBC) mode. In some embodiments, theone or more allowed prediction modes comprise an inter mode.

In some embodiments, the video region includes an intra slice, an intrapicture, or an intra tile group. In some embodiments, the one or moreallowed prediction modes comprise the intra mode, the intra block copymode, and the palette mode.

In some embodiments, the video region includes an inter slice, an interpicture, an inter tile group, a P slice, a B slice, a P picture, or a Bpicture. In some embodiments, the one or more allowed prediction modescomprise the intra mode, the intra block copy mode, the palette mode,and the inter mode.

In some embodiments, the block has a dimension of 4×4. In someembodiments, the one or more allowed prediction modes exclude the intermode in case the block has a dimension of 4×4.

In some embodiments, the bitstream representation includes at least aprediction mode index representing the one or more allowed predictionmodes in case the block is not coded in a skip mode, wherein theprediction mode index is represented using one or more binary bins.

In some embodiments, the prediction mode index is represented usingthree binary bins, wherein a first bin value of ‘1’ indicates an intramode, wherein the first bin value of ‘0’ and a second bin value of ‘0’indicates an inter mode, wherein the first bin value of ‘0’, the secondbin value of ‘1’, and a third bin value of ‘0’ indicates an IBC mode,and wherein the first bin value of ‘0’, the second value of ‘1’, and thethird bin value of ‘1’ indicates a palette mode.

In some embodiments, the prediction mode index is represented using twobinary bins, wherein a first bin value of ‘1’ and a second bin value of‘0’ indicate an intra mode, wherein the first bin value of ‘0’ and thesecond bin value of ‘0’ indicate an inter mode, wherein the first binvalue of ‘0’ and the second bin value of ‘1’ indicate an IBC mode, andwherein the first bin value of ‘1’ and the second bin value of ‘1’indicate a palette mode.

In some embodiments, the prediction mode index is represented using onebinary bin in case a current slice of the video is an intra slice and anIBC mode is disabled, a first bin value of ‘0’ indicates an intra mode,and a second bin value of ‘1’ indicates a palette mode.

In some embodiments, the prediction mode index is represented using twobinary bins in case a current slice of the video is not an intra sliceand an IBC mode is disabled, wherein a first bin value of ‘1’ indicatesan intra mode, wherein the first bin value of ‘0’ and a second bin valueof ‘0’ indicate an inter mode, and wherein the first bin value of ‘0’and the second bin value of ‘1’ indicate a palette mode. In someembodiments, the prediction mode index is represented using two binarybins in case a current slice of the video is an intra slice and an IBCmode is enabled, wherein a first bin value of ‘1’ indicates the IBCmode, wherein the first bin value of ‘0’ and a second bin value of ‘1’indicate a palette mode, and wherein the first bin value of ‘0 and thesecond bin value of ‘0’ indicate an intra mode. In some embodiments, theindication of the usage of the IBC mode signalled in a sequenceparameter set (SPS) of the bitstream representation.

In some embodiments, the prediction mode index is represented usingthree binary bins, wherein a first bin value of ‘1’ indicates an intermode, wherein the first bin value of ‘0’ and a second bin value of ‘1’indicate an intra mode, wherein the first bin value of ‘0’, the secondbin value of ‘0’, and a third bin value of ‘1’ indicate an IBC mode, andwherein the first bin value of ‘0’, the second bin value of ‘0’, and thethird bin value of ‘0’ indicate a palette mode.

In some embodiments, the prediction mode index is represented usingthree binary bins, wherein a first bin value of ‘1’ indicates an intramode, wherein the first bin value of ‘0’ and a second bin value of ‘1’indicate an inter mode, wherein the first bin value of ‘0’, the secondbin value of ‘0’, and a third bin value of ‘1’ indicate an IBC mode, andwherein the first bin value of ‘0’, the second bin value of ‘0’, and thethird bin value of ‘0’ indicate a palette mode.

In some embodiments, the prediction mode index is represented usingthree binary bins, wherein a first bin value of ‘0’ indicates an intermode, wherein the first bin value of ‘1’ and a second bin value of ‘0’indicate an intra mode, wherein the first bin value of ‘1’, the secondbin value of ‘1’, and a third bin value of ‘1’ indicate an IBC mode, andwherein the first bin value of ‘1’, the second bin value of ‘1’, and thethird bin value of ‘0’ indicate a palette mode.

In some embodiments, signalling of one of the one or more binary bins isskipped in the bitstream representation in case a condition issatisfied. In some embodiments, the condition comprises a dimension ofthe block. In some embodiments, the condition comprises a predictionmode being disabled, and wherein a binary bin corresponding to theprediction mode is skipped in the bitstream representation.

FIG. 27 is a flowchart representation of a method 2700 for videoprocessing in accordance with the present embodiments. The method 2700includes, at operation 2710, performing a conversion between a block ofa video and a bitstream representation of the video. The bitstreamrepresentation is processed according to a format rule that specifies afirst indication of usage of a palette mode and a second indication ofusage of an intra block copy (IBC) mode are signalled dependent of eachother.

In some embodiments, the format rule specifies that the first indicationis signalled in the bitstream representation in case a prediction modeof the block is equal to a first prediction mode that is not the IBCmode. In some embodiments, the format rule specifies that the secondindication is signalled in the bitstream representation in case aprediction mode of the block is equal to a first prediction mode that isnot the palette mode. In some embodiments, the first prediction mode isan intra mode.

FIG. 28 is a flowchart representation of a method 2800 for videoprocessing in accordance with the present embodiments. The method 2800includes, at operation 2810, determining, for a conversion between ablock of a video and a bitstream representation of the video, a presenceof an indication of usage of a palette mode in the bitstreamrepresentation based on a dimension of the block. The method 2800includes, at operation 2820, performing the conversion based on thedetermining.

FIG. 29 is a flowchart representation of a method 2900 for videoprocessing in accordance with the present embodiments. The method 2900includes, at operation 2910, determining, for a conversion between ablock of a video and a bitstream representation of the video, a presenceof an indication of usage of an intra block copy (IBC) mode in thebitstream representation based on a dimension of the block. The method2900 includes, at operation 2920, performing the conversion based on thedetermining. In some embodiments, the dimension of the block comprisesat least one of: a number of samples in the block, a width of the block,or a height of the block.

In some embodiments, the indication is signalled in the bitstreamrepresentation in case the width of the block is equal to or smallerthan a threshold. In some embodiments, the indication is signalled inthe bitstream representation in case the height of the block is equal toor smaller than a threshold. In some embodiments, the threshold is 64.

In some embodiments, the indication is signalled in the bitstreamrepresentation in case the width and the height of the block is largerthan a threshold. In some embodiments, the threshold is 4. In someembodiments, the indication is signalled in the bitstream representationin case the number of samples in the block is larger than a threshold.In some embodiments, the threshold is 16. In some embodiments, theindication is signalled in the bitstream representation in case a widthof the block is equal to a height of the block.

In some embodiments, the indication is not present in the bitstreamrepresentation in case (1) the width of the block is greater than afirst threshold, (2) the height of the block is greater than a secondthreshold, or (3) the number of samples in the block is equal to orsmaller than a third threshold. In some embodiments, the first thresholdand the second threshold are 64. In some embodiments, the thirdthreshold is 16.

In some embodiments, the determining is further based on acharacteristic associated with the block. In some embodiments, thecharacteristic comprises a prediction mode of the block. In someembodiments, the characteristic comprises a quantization parameter ofthe block. In some embodiments, the characteristic comprises a paletteflag of a neighboring block of the block. In some embodiments, thecharacteristic comprises an IBC flag of a neighboring block of theblock. In some embodiments, the characteristic comprises an indicationof a color format of the block. In some embodiments, the characteristiccomprises a coding tree structure of the block. In some embodiments, thecharacteristic comprises a slice group type, a tile group type, or apicture type of the block.

FIG. 30 is a flowchart representation of a method 3000 for videoprocessing in accordance with the present embodiments. The method 3000includes, at operation 3010, determining, for a conversion between ablock of a video and a bitstream representation of the video, whether apalette mode is allowed for the block based on a second indication of avideo region containing the block. The method 3000 also includes, atoperation 3020, performing the conversion based on the determining.

In some embodiments, the video region comprises a slice, a tile group,or a picture. In some embodiments, the bitstream representation excludesan explicit indication of whether the palette mode is allowed in casethe second indication indicates that a fractional motion vectordifference is enabled. In some embodiments, the second indication isrepresented as a flag that is present in the bitstream representation.In some embodiments, the second indication indicates whether the palettemode is enabled for the video region. In some embodiments, the bitstreamrepresentation excludes an explicit indication of whether the palettemode is allowed in case the second indication indicates the palette modeis disabled for the video region. In some embodiments, the palette modeis disallowed for the block in case the bitstream representationexcludes an explicit indication of whether the palette mode is allowed.

FIG. 31 is a flowchart representation of a method 3100 for videoprocessing in accordance with the present embodiments. The method 3100includes, at operation 3110, determining, for a conversion between ablock of a video and a bitstream representation of the video, whether anintra block copy (IBC) mode is allowed for the block based on a secondindication of a video region containing the block. The method 3100 alsoincludes, at operation 3120, performing the conversion based on thedetermining.

In some embodiments, the video region comprises a slice, a tile group,or a picture. In some embodiments, the bitstream representation excludesan explicit indication of whether the IBC mode is allowed in case thesecond indication indicates that a fractional motion vector differenceis enabled. In some embodiments, the second indication is represented asa flag that is present in the bitstream representation. In someembodiments, the second indication indicates whether the IBC mode isenabled for the video region. In some embodiments, the bitstreamrepresentation excludes an explicit indication of whether the IBC modeis allowed in case the second indication indicates the IBC mode isdisabled for the video region. In some embodiments, the IBC mode isdisallowed for the block in case the bitstream representation excludesan explicit indication of whether the IBC mode is allowed.

FIG. 32 is a flowchart representation of a method 3200 for videoprocessing in accordance with the present embodiments. The method 3200includes, at operation 3210, determining, for a conversion between ablock of a video and a bitstream representation of the video, a firstbit depth of a first sample associated with a palette entry in a palettemode. The first bit depth is different from a second bit depthassociated with the block. The method 3200 also includes, at operation3220, performing the conversion based on the determining.

In some embodiments, the second bit depth comprises an internal bitdepth for the block. In some embodiments, the second bit depth comprisesa bit depth associated with an original sample of the block. In someembodiments, the second bit depth comprises a bit depth associated witha reconstructed sample of the block. In some embodiments, the first bitdepth is a positive integer. In some embodiments, the first bit depth isequal to 8. In some embodiments, the first bit depth is larger than thesecond bit depth. In some embodiments, the first bit depth is smallerthan the second bit depth. In some embodiments, the first bit depth isdetermined based on a dimension of the block. In some embodiments, thefirst bit depth is determined based on a quantization parameter of theblock. In some embodiments, the first bit depth is determined based onan indication of a color format of the block. In some embodiments, thefirst bit depth is determined based on a coding tree structure of theblock. In some embodiments, the first bit depth is determined based on aslice group type, a tile group type, or a picture type of the block.

In some embodiments, the first bit depth is determined based on a numberof palette entries associated with the block. In some embodiments, thefirst bit depth is determined based on a number of entries in a palettepredictor associated with the block. In some embodiments, the first bitdepth is determined based on one or more indices of a color component ofthe block.

In some embodiments, a second sample is associated with another paletteentry in the palette mode, the second sample having a third bit depththat is different than the first bit depth. In some embodiments, thethird bit depth is larger than the second bit depth. In someembodiments, the third bit depth is smaller than the second bit depth.

In some embodiments, a third sample of the block is reconstructed basedon shifting a value of the first sample by M bits, M being a positiveinteger. In some embodiments, shifting the value of the first samplecomprises left shifting the first sample by M bits. In some embodiments,the first sample has a value of C, and wherein the reconstructed secondsample has a value of (C<<M)+(1<<(M−1)). In some embodiments, shiftingthe value of the first sample comprises right shifting the first sampleby M bits. In some embodiments, the first sample has a value of C, andwherein the reconstructed second sample has a value that is determinedbased on (C+(1<<(M−1)))>>M, the value being limited by a minimal valueof 0 and a maximum value of (1<<N)−1. In some embodiments, M isdetermined based on a difference between the first bit depth and thesecond bit depth. In some embodiments, M is equal to the second bitdepth minus the first bit depth. In some embodiments, M is equal to thefirst bit depth minus the second bit depth. In some embodiments, M isequal to 2. In some embodiments, M is determined based on a dimension ofthe block. In some embodiments, M is determined based on a quantizationparameter of the block. In some embodiments, M is determined based on anindication of a color format of the block. In some embodiments, M isdetermined based on a coding tree structure of the block. In someembodiments, M is determined based on a slice group type, a tile grouptype, or a picture type of the block. In some embodiments, M isdetermined based on a number of palette entries associated with theblock. In some embodiments, M is determined based on a number ofprediction palette entries associated with the block. In someembodiments, M is determined based on a position of the first sample andthe third sample in the block. In some embodiments, M is determinedbased on an index of a color component of the block.

In some embodiments, the method comprises determining the first sampleassociated with the palette entry based on a look-up operation performedon a table of samples. In some embodiments, values of the table ofsamples are signalled in a sequence parameter set (SPS), a videoparameter set (VPS), a picture parameter set (PPS), a picture header, aslice header, a tile group header, a row of a largest coding unit (LCU),or a group of LCUs in the bitstream representation. In some embodiments,values of the table of samples are derived based on information in anSPS, a VPS, a PPS, a picture header, a slice header, a tile groupheader, a row of an LCU, or a group of LCUs in the bitstreamrepresentation.

FIG. 33 is a flowchart representation of a method 3300 for videoprocessing in accordance with the present embodiments. The method 3300includes, at operation 3310, determining, for a conversion between acurrent block of a video and a bitstream representation of the video,that a neighboring block of the current block that is coded in a palettemode is processed as an intra-coded block having a default mode during aconstruction of a list of most probable modes (MPM) candidates of thecurrent block in case the neighboring block is located above or left ofthe current block. The method 3300 includes, at operation 3320,performing the conversion based on the determining.

In some embodiments, the default mode comprises a planar mode. In someembodiments, the default mode comprises a DC mode, a vertical mode, or ahorizontal mode. In some embodiments, the default mode is signalled in aDPS, an SPS, a VPS, a PPS, a picture header, a slice header, a tilegroup header, an LCU, a CU, an LCU row, a group of LCUs, a TU, a PUblock, or a video coding unit in the bitstream representation.

FIG. 34 is a flowchart representation of a method 3400 for videoprocessing in accordance with the present embodiments. The method 3400includes, at operation 3410, determining, for a block of a video that iscoded in a bitstream representation of the video as a palette mode codedblock, a parameter for deblocking filtering according to a rule. Themethod 3400 also includes, at operation 3420, performing a conversionbetween the block and the bitstream representation of the video usingthe parameter for deblocking filtering.

In some embodiments, the rule specifies that, for the determining theparameter for deblocking filtering, the block is treated as an intracode block of the video.

In some embodiments, a boundary strength for the deblocking filtering is2 in case a first side of a boundary of the block or a second side ofthe boundary of the block is coded in the palette mode. In someembodiments, a boundary strength for the deblocking filtering isdetermined to be 2 in case a first side of a boundary of the block and asecond side of the boundary of the block are coded in the palette mode.In some embodiments, the rule specifies that, for the determining theparameter for deblocking filtering, the block is treated as an intercoded block of the video.

In some embodiments, the rule specifies that, for the determining theparameter for deblocking filtering, the palette mode is treatedseparately from other modes in the deblocking filtering. In someembodiments, a boundary strength for the deblocking filtering isdetermined to be 0 in case a first side of a boundary of the block or asecond side of the boundary of the block is coded in the palette mode.In some embodiments, a boundary strength for the deblocking filtering is1 in case a first side of a boundary of the block is coded in thepalette mode and a second side of the boundary of the block is coded inan intra block copy (IBC) mode. In some embodiments, a boundary strengthfor the deblocking filtering is 2 in case a first side of a boundary ofthe block is coded in the palette mode and a second side of the boundaryof the block is coded in an intra mode.

In some embodiments, the rule specifies that, for the determining theparameter for deblocking filtering, the palette mode is treated as atransform-skip mode in the deblocking filtering. In some embodiments,the rule specifies that, for the determining the parameter fordeblocking filtering, the palette mode is treated as a block-based deltapulse code modulation (BDPCM) mode in the deblocking filtering.

FIG. 35 is a flowchart representation of a method 3500 for videoprocessing in accordance with the present embodiments. The method 3500includes, at operation 3410, determining, for a conversion between acurrent block of a video and a bitstream representation of the video,that a neighboring block of the current block that is coded in a palettemode is processed as a non-intra coded block during a construction of alist of most probable modes (MPM) candidates of the current block. Themethod 3500 also includes, at operation 3520, performing the conversionbased on the determining.

In some embodiments, the neighboring block is processed as aninter-coded block in case the neighboring block is located above or leftof the current block. In some embodiments, the neighboring block isprocessed as an intra block copy (IBC) coded block in case theneighboring block is located above or left of the current block.

FIG. 36A is a flowchart representation of a method 3600 for videoprocessing in accordance with the present embodiments. The method 3600includes, at operation 3610, determining, for a block of a video, aquantization parameter associated with the block. The method 3600includes, at operation 3620, coding the block of the video into abitstream representation of the video as a palette coded block in partbased on a modified value of the quantization parameter. The method alsoincludes, at operation 3630, signalling coded information related to thequantization parameter in the bitstream representation.

FIG. 36B is a flowchart representation of a method 3650 for videoprocessing in accordance with the present embodiments. The method 3650includes, at operation 3660, deriving a quantization parameter based ona bitstream representation of a video. The method 3650 also includes, atoperation 3670, decoding a palette coded block in part based on amodified quantization parameter determined by modifying the quantizationparameter.

In some embodiments, the quantization parameter is modified based onsetting a highest limit for the quantization parameter. In someembodiments, the quantization parameter is modified based on setting alowest limit for the quantization parameter. In some embodiments, thequantization parameter is modified in a same manner as a secondquantization parameter associated with a block coded in a transform skipmode. In some embodiments, the quantization parameter is modified in asame manner as a third quantization parameter associated with a blockcoded in a block-based delta pulse code modulation (BDPCM) mode.

In some embodiments, the quantization parameter is denoted as Qp, andwherein modifying the quantization parameter comprises revising a valueof Qp to be max (Qp, 4+T), T being a non-negative integer value. In someembodiments, T is based on a predefined threshold. In some embodiments,T is 4+Ts, and Ts is signalled in the bitstream representation. In someembodiments, Ts is signalled in a syntax element min_qp_prime_ts_minus4in the bitstream representation.

FIG. 37 is a flowchart representation of a method 3700 for videoprocessing in accordance with the present embodiments. The method 3700includes, at operation 3710, determining, for a block of a video that iscoded in a bitstream representation of the video as a palette codedblock, a representation of an escape sample of the block in thebitstream representation regardless of whether a bypass mode is enabledfor the block. The method 3700 also includes, at operation 3720,performing a conversion between the block and the bitstreamrepresentation based on the determining.

In some embodiments, the escape sample is represented in the bitstreamrepresentation using a fixed length. In some embodiments, the fixedlength comprises N bits, N being a positive integer. In someembodiments, N is 8 or 10.

In some embodiments, the escape sample is represented in the bitstreamrepresentation using a length determined based on an internal bit depthof the block. In some embodiments, the escape sample is represented inthe bitstream representation using a length determined based on an inputbit depth of the block. In some embodiments, the escape sample isrepresented in the bitstream representation using a length determinedbased on a quantization parameter of the block. In some embodiments, thelength is defined as a function of the quantization parameter denoted asf(Qp). In some embodiments, an internal bit depth of the block is d, andwherein f(Qp)=(d−(Qp−4)/6).

FIG. 38 is a flowchart representation of a method 3800 for videoprocessing in accordance with the present embodiments. The method 3800includes, at operation 3810, determining, for a block of a video that iscoded in a bitstream representation of the video as a palette codedblock, a first quantization process. The first quantization process isdifferent from a second quantization process applicable to a non-palettemode coded block. The method 3800 also includes, at operation 3820,performing a conversion between the block and the bitstreamrepresentation based on the determining.

In some embodiments, the first quantization process comprises rightbit-shifting an escape sample of the block for quantizing the escapesample. In some embodiments, the first quantization process comprisesleft bit-shifting an escape sample of the block for inverse quantizingthe escape sample. In some embodiments, a sample is denoted as p and aquantization sample is denoted as Qp, and wherein a value of the escapesample is coded as a function of p and Qp denoted as f(p, Qp). In someembodiments, f(p, Qp)=p>>((Qp−4)/6). In some embodiments, a sample isdenoted as p and a value of the escape sample is coded as p>>N, N beingan integer. In some embodiments, N is 2. In some embodiments, N isdetermined based on a characteristic associated with the block.

In some embodiments, the characteristic comprises a value signalled inan SPS, a VPS, a PPS, a picture header, a slice header, a tile groupheader, a row of LCU, or a group of LCUs. In some embodiments, thecharacteristic comprises an internal bit depth of the block. In someembodiments, the characteristic comprises an input bit depth of theblock. In some embodiments, the characteristic comprises a dimension ofthe block. In some embodiments, the characteristic comprises aquantization parameter of the block. In some embodiments, thecharacteristic comprises an indication of a color format of the block.In some embodiments, the characteristic comprises a coding treestructure of the block. In some embodiments, the characteristiccomprises a slice type, a tile group type, or a picture type associatedwith the block.

In some embodiments, a sample is denoted as p, a bit depth associatedwith the block is denoted as bd, and a quantization sample is denoted asQp, and wherein a value of the escape sample is signalled as a functionof bd, p and, Qp denoted as f(bd, p, Qp). In some embodiments, f(bd, p,Qp)=clip (0, (1<<(bd−(Qp−4)/6))−1, (p+(1<<(bd−1)))>>((Qp−4)/6)). In someembodiments, f(bd, p, Qp)=clip(0, (1<<bd)−1, p<<((Qp−4)/6)). In someembodiments, clip is defined as clip(a, i, b)=(i<a?a:(i>b?b:i)). In someembodiments, clip is defined as clip(a, b)=(i<=a?a:(i>=b?b:i)). In someembodiments, the bit depth comprises an internal bit depth or an inputbit depth.

FIG. 39 is a flowchart representation of a method 3900 for videoprocessing in accordance with the present embodiments. The method 3900includes, at operation 3910, performing a conversion between a videocomprising luma blocks and corresponding chroma blocks and a bitstreamrepresentation of the video according to a rule. The rule specifiesthat, for a case that a current luma block is coded using a palettecoding mode and a corresponding current chroma block coded with aderived mode, the current luma block is treated as having a defaultintra prediction mode and the current chroma block is coded with thedefault intra prediction mode. The palette coding mode comprises codingthe current luma block using a palette of representative sample values.

In some embodiments, the current luma block coded using the palettecoding mode is processed as an intra block. In some embodiments, thecurrent luma block coded using the palette coding mode is processed as apalette block. In some embodiments, the default intra prediction modecomprises a DC mode, a planar mode, a vertical mode, or a horizontalmode. In some embodiments, the default intra prediction mode comprisesany intra prediction mode. In some embodiments, the default intraprediction mode is signalled in a DPS, an SPS, a VPS, a PPS, an APS, apicture header, a slice header, a tile group header, an LCU, a CU, anLCU row, a group of LCUs, a TU, a PU block, or a video coding unit.

FIG. 40 is a flowchart representation of a method 4000 for videoprocessing in accordance with the present embodiments. The method 4000includes, at operation 4010, performing a conversion between a videocomprising one or more blocks and a bitstream representation of thevideo. For the conversion, a list of motion candidates is constructedfor each block according to a rule. The rule specifies that the motioninformation of a block coded using a palette coding mode is treated asunavailable or invalid for coding successive blocks.

In some embodiments, the list of motion candidates comprises ahistory-based motion vector prediction candidate list. In someembodiments, the list of motion candidates comprises a merge candidatelist. In some embodiments, the list of motion candidates comprises amotion vector prediction candidate.

In some embodiments, the block is treated as having an invalid referenceindex. In some embodiments, the block is treated as having a referenceindex of 0. In some embodiments, the block is treated as having azero-motion vector.

In some embodiments, whether the rule is applicable is based on acharacteristic associated with the block. In some embodiments, thecharacteristic comprises a video content in the block. In someembodiments, the characteristic comprises a message signalled in a DPS,an SPS, a VPS, a PPS, an APS, a picture header, a slice header, a tilegroup header, an LCU, a CU, an LCU row, a group of LCUs, a TU, a PUblock, or a video coding unit associated with the block. In someembodiments, the characteristic comprises a position of a video regionassociated with the block, the video region comprising a CU, a PU, a TU,or a video coding unit. In some embodiments, the characteristiccomprises a dimension of the block or a neighboring block. In someembodiments, the characteristic comprises a shape of the block or aneighboring block. In some embodiments, the characteristic comprises anindication of a color format of the block. In some embodiments, thecharacteristic comprises a coding tree structure of the block. In someembodiments, the characteristic comprises a slice type, a tile grouptype, or a picture type of the block. In some embodiments, thecharacteristic comprises a color component of the block. In someembodiments, the characteristic comprises a temporal layer identifier ofthe block.

FIG. 41 is a flowchart representation of a method 4100 for videoprocessing in accordance with the present embodiments. The method 4100includes, at operation 4110, determining, for a block of video that iscoded in a bitstream representation of the video as a palette mode codedblock, a number of context coded bins of the block based on a rule. Themethod 4100 also includes, at operation 4120, performing a conversionbetween the block of the video and the bitstream representation of thevideo based on the determining.

In some embodiments, determining the number of context coded binscomprises assigning a counter to the block to track the number ofcontext coded bins. In some embodiments, the counter comprises a counterfor tracking a number of components to be coded in the block. In someembodiments, the counter is initialized to 0 and incremented by one foreach bin coded using context coding. In some embodiments, the counter isinitialized to N, N being a positive integer. The counter is decrementedby one for each bin coded using context coding.

In some embodiments, the rule specifies a threshold, the method furthercomprises applying bypass coding to additional number of bins thatexceeds or falls short of the threshold. In some embodiments, thethreshold is 0 or 1. In some embodiments, the threshold is determinedbased on a number of coding passes for the block or decoded informationof the block.

In some embodiments, the threshold is determined based on a secondthreshold associated with a number of context coded bins for transportstream (TS) coded blocks or non-TS coded blocks. In some embodiments,the second threshold is denoted as T, T being a positive number. Therule specifies that the threshold is W×H×T, W being a width of theblock, H being a height of the block. In some embodiments, the secondthreshold is denoted as T, T being a positive number. The rule specifiesthat the threshold is W×H×C×T, W being a width of the block, H being aheight of the block, and C being a number of color components to becoded in the block. In some embodiments, T is 1.75 or 2. In someembodiments, the threshold is smaller than the second threshold. In someembodiments, the threshold is larger than the second threshold.

FIG. 42 is a flowchart representation of a method 4200 for videoprocessing in accordance with the present embodiments. The method 4200includes, at operation 4210, determining, for a conversion between acurrent block of a video and a bitstream representation of the video, anumber of intra-coded neighboring blocks of the current block for acombined inter and intra prediction mode according to a rule. The rulespecifies a manner of treating a block coded using a palette coding modein counting the number of intra-coded neighboring blocks for thecombined inter and intra prediction mode, where using the palette codingmode comprises coding a block using a palette of representative samplevalues. The method 4200 also includes, at operation 4220, performing theconversion based on the determining.

In some embodiments, the manner specifies that a block coded using thepalette coding mode is treated as a non-intra-coded block to be excludedfrom the counting of the number of intra-coded neighboring blocks. Insome embodiments, the block coded using the palette coding mode istreated as a block having a prediction mode of MODE_PLT. In someembodiments, the block coded using the palette coding mode is treated asan inter-coded block. In some embodiments, the block coded using thepalette coding mode is treated as a block coded in an intra-block copy(IBC) coding mode in which the current block is coded with samples froma current picture of the current block. In some embodiments, the blockcoded using the palette coding mode is a neighboring block above thecurrent block or to the left of the current block.

In some embodiments, the manner specifies that a block coded using thepalette coding mode is treated as an intra coded block to be included inthe counting of the intra-coded neighboring blocks.

FIG. 43 is a flowchart representation of a method 4300 for videoprocessing in accordance with the present embodiments. The method 4300includes, at operation 4310, determining, for a conversion between acurrent block of a video and a bitstream representation of the video,that an operation is skipped for a sample of the current block in afiltering process. The sample is coded using a palette coding mode,where using the palette coding mode comprises coding a block using apalette of representative sample values. The method 4300 also includes,at operation 4320, performing the conversion based on the determining.

In some embodiments, the operation comprises a deblock operation thatsmooths one or more boundaries of the current block. In someembodiments, the operation comprises compensating an offset in a sampleadaptive offset process in which samples are categorized to reducedistortion. In some embodiments, the operation comprises a filteringoperation in an adaptive loop filtering process. In some embodiments,the operation comprises a classification operation in an adaptive loopfiltering process. In some embodiments, the operation comprises a lumamapping with chroma scaling operation in which luma samples are mappedusing an adaptive piecewise linear model and chroma samples aresubjected to a luma-dependent chroma residual scaling operation.

FIG. 44 is a flowchart representation of a method 4400 for videoprocessing in accordance with the present embodiments. The method 4400includes, at operation 4410, determining, for a conversion between ablock of a video and a bitstream representation of the video, a scanningorder selected from three or more scanning orders. The block is coded ina palette mode using a palette of representative sample values. Themethod 4400 includes, at operation 4420, performing the conversion basedon the determining.

In some embodiments, the three or more scanning orders comprise areverse horizontal transverse scanning order. In some embodiments, thereverse horizontal transverse scanning order comprises scanning theblock from left to right for rows having odd indices, where a first rowof the block is assigned an index 0. In some embodiments, the reversehorizontal transverse scanning order comprises scanning the block fromright to left for rows having even indices, where a first row of theblock is assigned an index 0.

In some embodiments, the three or more scanning orders comprise areverse vertical transverse scanning order. In some embodiments, thereverse vertical transverse scanning order comprises scanning the blockfrom top to bottom for columns having odd indices, where a first columnof the block is assigned an index 0. In some embodiments, the reversevertical transverse scanning order comprises scanning the block frombottom to top for columns having even indices, where a first column ofthe block is assigned an index 0.

In some embodiments, the three or more scanning orders comprise ahorizontal transverse scanning order that scans coefficients of theblock from left to right for rows having even indices and from right toleft for rows having odd indices. The three or more scanning ordersfurther comprises a vertical transverse scanning order that scans thecoefficients of the block from top to bottom for rows having evenindices and from bottom to top for rows having odd indices, where afirst row of the block is assigned an index 0 and a first column of theblock is assigned an index 0.

FIG. 45 is a flowchart representation of a method 4500 for videoprocessing in accordance with the present embodiments. The method 4500includes, at operation 4510, determining, for a conversion between ablock of a video and a bitstream representation of the video, one ormore scanning orders in which coefficients of the block are scannedbased on a shape of the block. The method 4500 also includes, atoperation 4520, performing the conversion based on the determining.

In some embodiments, the one or more scanning orders are applied in casea ratio of a width over a height of the block is greater than athreshold. In some embodiments, the one or more scanning orders areapplied in case a ratio of a height over a width of the block is greaterthan a threshold. In some embodiments, the threshold is equal to 1. Insome embodiments, the threshold is equal to 4.

FIG. 46 is a flowchart representation of a method 4600 for videoprocessing in accordance with the present embodiments. The method 4600includes, at operation 4610, determining, for a conversion between ablock of a video and a bitstream representation of the video, that onlyone scanning order in which coefficients of the block are scanned isapplied to the block for a block-based quantized residual domaindifferential pulse coding modulation (BDPCM) process in which adifference between a quantized residual of an intra prediction of theblock and a prediction of the quantized residual is represented in thebitstream representation of the block using a differential pulse codingmodulation (DPCM). The method 4600 also includes, at operation 4620,performing the conversion based on the determining.

In some embodiments, the only one scanning order comprises scanning theblock in a vertical direction in case a width of the block is greaterthan a height of the block. In some embodiments, the only one scanningorder comprises scanning the block in a horizontal direction in case awidth of the block is smaller than a height of the block. In someembodiments, the only one scanning order is derived based on a shape ofthe block.

In some embodiments, at least one scanning order is applicable in case awidth of the block denoted as W and a height of the block denoted as Hsatisfy a condition. In some embodiments, the condition comprises W×Th≥Hor H×Th≥W, Th being a threshold that is an integer. In some embodiments,Th is 4 or 8. In some embodiments, Th is determined based on acharacteristic of the video. In some embodiments, the characteristiccomprises a content of the video. In some embodiments, thecharacteristic comprises information signalled in a DPS, an SPS, a VPS,a PPS, an APS, a picture header, a slice header, a tile group header, anLCU, a CU, a row of a LCU, a group of LCUs, a TU, a PU block, or a videocoding unit of the bitstream representation. In some embodiments, thecharacteristic comprises a position of the block in a video picture ofthe video. In some embodiments, the characteristic comprises a dimensionof the block or a dimension of a neighboring block of the block. In someembodiments, the characteristic comprises a shape of the block or ashape of a neighboring block of the block. In some embodiments, thecharacteristic comprises a color format of the block. In someembodiments, the characteristic comprises a coding tree structure of thevideo. In some embodiments, the characteristic comprises slice type,tile group type or a picture type of the video. In some embodiments, thecharacteristic comprises a color component of the block. In someembodiments, the characteristic comprises a temporal layer identity ofthe video. In some embodiments, the characteristic comprises a profile,a level, a tier of a standard for the video.

In some embodiments, the conversion generates the current block from thebitstream representation. In some embodiments, the conversion generatesthe bitstream representation from the current block.

Some embodiments of the present disclosure include making a decision ordetermination to enable a video processing tool or mode. In an example,when the video processing tool or mode is enabled, the encoder will useor implement the tool or mode in the processing of a block of video, butmay not necessarily modify the resulting bitstream based on the usage ofthe tool or mode. That is, a conversion from the block of video to thebitstream representation of the video will use the video processing toolor mode when it is enabled based on the decision or determination. Inanother example, when the video processing tool or mode is enabled, thedecoder will process the bitstream with the knowledge that the bitstreamhas been modified based on the video processing tool or mode. That is, aconversion from the bitstream representation of the video to the blockof video will be performed using the video processing tool or mode thatwas enabled based on the decision or determination.

Some embodiments of the present disclosure include making a decision ordetermination to disable a video processing tool or mode. In an example,when the video processing tool or mode is disabled, the encoder will notuse the tool or mode in the conversion of the block of video to thebitstream representation of the video. In another example, when thevideo processing tool or mode is disabled, the decoder will process thebitstream with the knowledge that the bitstream has not been modifiedusing the video processing tool or mode that was enabled based on thedecision or determination.

The disclosed and other solutions, examples, embodiments, modules andthe functional operations described in this disclosure can beimplemented in digital electronic circuitry, or in computer software,firmware, or hardware, including the structures disclosed in thisdisclosure and their structural equivalents, or in combinations of oneor more of them. The disclosed and other embodiments can be implementedas one or more computer program products, i.e., one or more modules ofcomputer program instructions encoded on a computer readable medium forexecution by, or to control the operation of, data processing apparatus.The computer readable medium can be a machine-readable storage device, amachine-readable storage substrate, a memory device, a composition ofmatter effecting a machine-readable propagated signal, or a combinationof one or more them. The term “data processing apparatus” encompassesall apparatus, devices, and machines for processing data, including byway of example a programmable processor, a computer, or multipleprocessors or computers. The apparatus can include, in addition tohardware, code that creates an execution environment for the computerprogram in question, e.g., code that constitutes processor firmware, aprotocol stack, a database management system, an operating system, or acombination of one or more of them. A propagated signal is anartificially generated signal, e.g., a machine-generated electrical,optical, or electromagnetic signal, that is generated to encodeinformation for transmission to suitable receiver apparatus.

A computer program (also known as a program, software, softwareapplication, script, or code) can be written in any form of programminglanguage, including compiled or interpreted languages, and it can bedeployed in any form, including as a stand-alone program or as a module,component, subroutine, or other unit suitable for use in a computingenvironment. A computer program does not necessarily correspond to afile in a file system. A program can be stored in a portion of a filethat holds other programs or data (e.g., one or more scripts stored in amarkup language document), in a single file dedicated to the program inquestion, or in multiple coordinated files (e.g., files that store oneor more modules, sub programs, or portions of code). A computer programcan be deployed to be executed on one computer or on multiple computersthat are located at one site or distributed across multiple sites andinterconnected by a communication network.

The processes and logic flows described in this disclosure can beperformed by one or more programmable processors executing one or morecomputer programs to perform functions by operating on input data andgenerating output. The processes and logic flows can also be performedby, and apparatus can also be implemented as, special purpose logiccircuitry, e.g., a field-programmable gate array (FPGA) or anapplication-specific integrated circuit (ASIC).

Processors suitable for the execution of a computer program include, byway of example, both general and special purpose microprocessors, andany one or more processors of any kind of digital computer. Generally, aprocessor will receive instructions and data from a read only memory ora random-access memory or both. The essential elements of a computer area processor for performing instructions and one or more memory devicesfor storing instructions and data. Generally, a computer will alsoinclude, or be operatively coupled to receive data from or transfer datato, or both, one or more mass storage devices for storing data, e.g.,magnetic, magneto optical disks, or optical disks. However, a computerneed not have such devices. Computer readable media suitable for storingcomputer program instructions and data include all forms of non-volatilememory, media and memory devices, including by way of examplesemiconductor memory devices, e.g., erasable programmable read-onlymemory (EPROM), electronically erasable programmable read-only memory(EEPROM), and flash memory devices; magnetic disks, e.g., internal harddisks or removable disks; magneto optical disks; and compact disc,read-only memory (CD-ROM) and digital versatile disc, read-only memory(DVD-ROM) disks. The processor and the memory can be supplemented by, orincorporated in, special purpose logic circuitry.

While the present disclosure contains many specifics, these should notbe construed as limitations on the scope of any subject matter or ofwhat may be claimed, but rather as descriptions of features that may bespecific to particular embodiments of the present disclosure. Certainfeatures that are described in the present disclosure in the context ofseparate embodiments can also be implemented in combination in a singleembodiment. Conversely, various features that are described in thecontext of a single embodiment can also be implemented in multipleembodiments separately or in any suitable subcombination. Moreover,although features may be described above as acting in certaincombinations and even initially claimed as such, one or more featuresfrom a claimed combination can in some cases be excised from thecombination, and the claimed combination may be directed to asubcombination or variation of a subcombination.

Similarly, while operations are depicted in the drawings in a particularorder, this should not be understood as requiring that such operationsbe performed in the particular order shown or in sequential order, orthat all illustrated operations be performed, to achieve desirableresults. Moreover, the separation of various system components in theembodiments described in the present disclosure should not be understoodas requiring such separation in all embodiments.

Only a few embodiments and examples are described and other embodiments,enhancements and variations can be made based on what is described andillustrated in the present disclosure.

What is claimed is:
 1. A method for processing video data, comprising:determining, for a conversion between a current block of a video and abitstream representation of the video, a number of intra-codedneighboring blocks of the current block for a combined inter-intraprediction mode according to a rule; and performing the conversion basedon the determining, wherein in the combined inter-intra prediction mode,a prediction signal of the current video block is generated at leastbased on an intra prediction signal and an inter prediction signal,wherein the rule specifies that a first block coded using a firstprediction mode is treated as a non-intra block to be excluded fromcounting of the number of intra-coded neighboring blocks, and wherein inthe first prediction mode, reconstructed samples are represented by aset of representative color values, and the set of representative colorvalues comprises at least one of 1) palette predictors, 2) escapedsamples, or 3) palette information included in the bitstream.
 2. Themethod of claim 1, wherein the first block is treated as a block havinga prediction mode of MODE_PLT.
 3. The method of claim 1, wherein therule specifies that the first block is treated in a same manner as asecond block coded in a second prediction mode in counting of the numberof intra-coded neighboring blocks, wherein in the second predictionmode, prediction samples are derived from blocks of sample values of asame video region as determined by block vectors.
 4. The method of claim3, wherein the second block coded is treated as a non-intra block to beexcluded from counting of the number of intra-coded neighboring blocks.5. The method of claim 1, wherein a deblocking filtering process isskipped for a sample of the first block.
 6. The method of claim 1,further comprising determining that a luma mapping process including apiecewise linear model is not applied for the first block.
 7. The methodof claim 1, wherein the conversion includes encoding the video into thebitstream.
 8. The method of claim 1, wherein the conversion includesdecoding the bitstream from the video.
 9. An apparatus for processingvideo data comprising a processor and a non-transitory memory withinstructions thereon, wherein the instructions upon execution by theprocessor, cause the processor to: determine, for a conversion between acurrent block of a video and a bitstream representation of the video, anumber of intra-coded neighboring blocks of the current block for acombined inter-intra prediction mode according to a rule; and performthe conversion based on the determining, wherein in the combinedinter-intra prediction mode, a prediction signal of the current videoblock is generated at least based on an intra prediction signal and aninter prediction signal, wherein the rule specifies that a first blockcoded using a first prediction mode is treated as a non-intra block tobe excluded from counting of the number of intra-coded neighboringblocks, and wherein in the first prediction mode, reconstructed samplesare represented by a set of representative color values, and the set ofrepresentative color values comprises at least one of 1) palettepredictors, 2) escaped samples, or 3) palette information included inthe bitstream.
 10. The apparatus of claim 9, wherein the first block istreated as a block having a prediction mode of MODE_PLT.
 11. Theapparatus of claim 9, wherein the rule specifies that the first block istreated in a same manner as a second block coded in a second predictionmode in counting of the number of intra-coded neighboring blocks,wherein in the second prediction mode, prediction samples are derivedfrom blocks of sample values of a same video region as determined byblock vectors.
 12. The apparatus of claim 11, wherein the second blockcoded is treated as a non-intra block to be excluded from counting ofthe number of intra-coded neighboring blocks.
 13. The apparatus of claim9, wherein a deblocking filtering process is skipped for a sample of thefirst block.
 14. The apparatus of claim 9, wherein the instructions uponexecution by the processor, further cause the processor to determinethat a luma mapping process including a piecewise linear model is notapplied for the first block.
 15. The apparatus of claim 9, wherein theconversion includes encoding the video into the bitstream.
 16. Theapparatus of claim 9, wherein the conversion includes decoding thebitstream from the video.
 17. A non-transitory computer-readable storagemedium storing instructions that cause a processor to: determine, for aconversion between a current block of a video and a bitstreamrepresentation of the video, a number of intra-coded neighboring blocksof the current block for a combined inter-intra prediction modeaccording to a rule; and perform the conversion based on thedetermining, wherein in the combined inter-intra prediction mode, aprediction signal of the current video block is generated at least basedon an intra prediction signal and an inter prediction signal, whereinthe rule specifies that a first block coded using a first predictionmode is treated as a non-intra block to be excluded from counting of thenumber of intra-coded neighboring blocks, and wherein in the firstprediction mode, reconstructed samples are represented by a set ofrepresentative color values, and the set of representative color valuescomprises at least one of 1) palette predictors, 2) escaped samples, or3) palette information included in the bitstream.
 18. The non-transitorycomputer-readable storage medium of claim 17, wherein the first block istreated as a block having a prediction mode of MODE_PLT, wherein therule specifies that the first block is treated in a same manner as asecond block coded in a second prediction mode in counting of the numberof intra-coded neighboring blocks, and wherein in the second predictionmode, prediction samples are derived from blocks of sample values of asame video region as determined by block vectors.
 19. A non-transitorycomputer-readable recording medium storing a bitstream of a video whichis generated by a method performed by a video processing apparatus,wherein the method comprises: determining, a number of intra-codedneighboring blocks of a current block of a video for a combinedinter-intra prediction mode according to a rule; and generating thebitstream based on the determining, wherein in the combined inter-intraprediction mode, a prediction signal of the current video block isgenerated at least based on an intra prediction signal and an interprediction signal, wherein the rule specifies that a first block codedusing a first prediction mode is treated as a non-intra block to beexcluded from counting of the number of intra-coded neighboring blocks,and wherein in the first prediction mode, reconstructed samples arerepresented by a set of representative color values, and the set ofrepresentative color values comprises at least one of 1) palettepredictors, 2) escaped samples, or 3) palette information included inthe bitstream.
 20. The non-transitory computer-readable recording mediumof claim 19, wherein the first block is treated as a block having aprediction mode of MODE_PLT, wherein the rule specifies that the firstblock is treated in a same manner as a second block coded in a secondprediction mode in counting of the number of intra-coded neighboringblocks, and wherein in the second prediction mode, prediction samplesare derived from blocks of sample values of a same video region asdetermined by block vectors.